Evolving Mobile Architectures - Developer Version

1,407 views
1,318 views

Published on

I've previously given a number of talks on mobile architecture, mostly from a strategy and agility point of view, and one from a technical point of view at Swipe. Here is a slide deck for a version of the same talk I gave but for a developer audience, with a few more code samples.

Published in: Technology, Design
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,407
On SlideShare
0
From Embeds
0
Number of Embeds
477
Actions
Shares
0
Downloads
33
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Evolving Mobile Architectures - Developer Version

  1. 1. EVOLVING MOBILE ARCHITECTURES Stewart Gleadow @stewgleadow stew@rea-group.com Thursday, 4 July 13
  2. 2. Remember the early days of the web? http://www.icehousedesigns.com/webarchive/images/flshbk_COLLAGE2.gif Thursday, 4 July 13
  3. 3. What’s Jump-in?›❯ Initial mobile architecture›❯ Evolving Jump-in›❯ Recommendations›❯ Thursday, 4 July 13
  4. 4. What’s Jump-in?›❯ Initial mobile architecture›❯ Evolving Jump-in›❯ Recommendations›❯ Thursday, 4 July 13
  5. 5. 77%use another device in front of the television Thursday, 4 July 13
  6. 6. Thursday, 4 July 13
  7. 7. Thursday, 4 July 13
  8. 8. Build a small team that delivers the product end-to-end. • Design and product • Front-end and back-end • Operations • (plus anything I forgot) Thursday, 4 July 13
  9. 9. BUILD MEASURELEARN Thursday, 4 July 13
  10. 10. What’s Jump-in?›❯ Initial mobile architecture›❯ Evolving Jump-in›❯ Recommendations›❯ Thursday, 4 July 13
  11. 11. How do you build an app that’s undefined and evolving? Thursday, 4 July 13
  12. 12. OR Thursday, 4 July 13
  13. 13. AND Thursday, 4 July 13
  14. 14. NATIVE HYBRID WEB Thursday, 4 July 13
  15. 15. Thursday, 4 July 13
  16. 16. WEB / NATIVE BRIDGE http://commons.wikimedia.org/wiki/File:Pont_du_Gard_HDR.jpg Thursday, 4 July 13
  17. 17. Signal from web to native Thursday, 4 July 13
  18. 18. <body onload="window.location = 'myapp://ready'"> Signal from web to native Thursday, 4 July 13
  19. 19. <body onload="window.location = 'myapp://ready'"> - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([request.URL.scheme isEqualToString:@"myapp"] && [request.URL.host isEqualToString:@"ready"]) { // We're done, you can display the content now return NO; } ... } Signal from web to native Thursday, 4 July 13
  20. 20. Use protocols to formalise the communication Thursday, 4 July 13
  21. 21. if ([request.URL.scheme isEqualToString:@"myapp"]) { SEL methodSel = NSSelectorFromString(request.URL.host); struct objc_method_description nativeMethod = protocol_getMethodDescription(@protocol(MyNativeMethods), methodSel, NO, YES); if (nativeMethod != NULL && [self.nativeDelegate respondsToSelector:methodSel] && ![NSObject instancesRespondToSelector:methodSel]) { // Turn into an NSInvocation and invoke it } return NO; } Use protocols to formalise the communication Thursday, 4 July 13
  22. 22. if ([request.URL.scheme isEqualToString:@"myapp"]) { SEL methodSel = NSSelectorFromString(request.URL.host); struct objc_method_description nativeMethod = protocol_getMethodDescription(@protocol(MyNativeMethods), methodSel, NO, YES); if (nativeMethod != NULL && [self.nativeDelegate respondsToSelector:methodSel] && ![NSObject instancesRespondToSelector:methodSel]) { // Turn into an NSInvocation and invoke it } return NO; } Use protocols to formalise the communication Thursday, 4 July 13
  23. 23. if ([request.URL.scheme isEqualToString:@"myapp"]) { SEL methodSel = NSSelectorFromString(request.URL.host); struct objc_method_description nativeMethod = protocol_getMethodDescription(@protocol(MyNativeMethods), methodSel, NO, YES); if (nativeMethod != NULL && [self.nativeDelegate respondsToSelector:methodSel] && ![NSObject instancesRespondToSelector:methodSel]) { // Turn into an NSInvocation and invoke it } return NO; } Use protocols to formalise the communication Thursday, 4 July 13
  24. 24. if ([request.URL.scheme isEqualToString:@"myapp"]) { SEL methodSel = NSSelectorFromString(request.URL.host); struct objc_method_description nativeMethod = protocol_getMethodDescription(@protocol(MyNativeMethods), methodSel, NO, YES); if (nativeMethod != NULL && [self.nativeDelegate respondsToSelector:methodSel] && ![NSObject instancesRespondToSelector:methodSel]) { // Turn into an NSInvocation and invoke it } return NO; } Use protocols to formalise the communication Thursday, 4 July 13
  25. 25. Running javascript from native code [webView stringByEvaluatingJavaScriptFromString:@"someFunction()"]; Thursday, 4 July 13
  26. 26. Thursday, 4 July 13
  27. 27. ARCHITECTURE MEANS YOU CAN RESPOND TO CHANGE FLEXIBILE HAVING A Thursday, 4 July 13
  28. 28. What’s Jump-in?›❯ Initial mobile architecture›❯ Evolving Jump-in›❯ Recommendations›❯ Thursday, 4 July 13
  29. 29. Thursday, 4 July 13
  30. 30. Thursday, 4 July 13
  31. 31. The app is just the tip of the iceberg Thursday, 4 July 13
  32. 32. App Backend Thursday, 4 July 13
  33. 33. App BackendAPI Decouple your app from the backend Thursday, 4 July 13
  34. 34. App BackendAPI Force logic to the API, keep the app simple Thursday, 4 July 13
  35. 35. http://www.flickr.com/photos/jakecaptive/3205277810 Forcing logic to the server Thursday, 4 July 13
  36. 36. http://www.flickr.com/photos/jakecaptive/3205277810 Forcing logic to the server What if you could only use NSDictionary objects for your domain model? Thursday, 4 July 13
  37. 37. How do we build simpler apps and smarter backends? • Principles of REST • Serving data and style • Product-aligned teams Thursday, 4 July 13
  38. 38. Populating web views with GRMoustache <div class="person"> <span class=”name”>{{name}}</span> {{#address}} <div class="address"> {{.}} </div> {{/address}} ... and all the other stuff </div> Thursday, 4 July 13
  39. 39. Populating web views with GRMoustache NSDictionary *person = @{ @"name": @"Stew", @"address": @"Melbourne" }; GRMustacheTemplate *template = ...; NSString *renderedContent = [template renderObject:person]; [webView loadHTMLString:renderedContent baseURL:...]; Should be populate templates on the client or the server? Thursday, 4 July 13
  40. 40. What’s Jump-in?›❯ Initial mobile architecture›❯ Evolving Jump-in›❯ Recommendations›❯ Thursday, 4 July 13
  41. 41. CONCENTRATE ON BUILDING A SIMPLE APP AND A GREAT API Thursday, 4 July 13
  42. 42. DON’T LOCK YOURSELF INTO DOING EVERYTHING NATIVELY OR EVERYTHING USING THE WEB Thursday, 4 July 13
  43. 43. ARCHITECTURE MEANS YOU CAN RESPOND TO CHANGE FLEXIBILE HAVING A Thursday, 4 July 13
  44. 44. Thank you Thursday, 4 July 13
  45. 45. EVOLVING MOBILE ARCHITECTURES Stewart Gleadow @stewgleadow stew@rea-group.com Thursday, 4 July 13

×