iPhonical and model-driven software development for the iPhone

2,295 views
2,152 views

Published on

These are the slides of my talk "iPhonical and model-driven software development on the iPhone" at the German iPhone Developer Conference 2009 in Cologne. Unfortunately, this version does not include the 25+ minutes demos I presented during the talk.

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

No Downloads
Views
Total views
2,295
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
82
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

iPhonical and model-driven software development for the iPhone

  1. 1. iPhonicalSoftware Development and Model-Driven Heiko Behrens (itemis) backchannel via #iphonical #iphonedevcon09
  2. 2. / soft·ware de·vel·op·ment / n. the set of activities that results in software products. ~ may include research, new development, modification, reuse, maintenance, or any other activities that result in software products.
  3. 3. Sketching some Typical Situations in Software Development #iphonical #iphonedevcon09
  4. 4. Boring code
  5. 5. Accidental complexity
  6. 6. Wrong level of abstraction
  7. 7. Anatomy of Modern Software Software artifact
  8. 8. Anatomy of Modern Software manually written code Frameworks Libraries
  9. 9. Anatomy of Modern Software manually written code Frameworks schematic code (manually written) Libraries
  10. 10. (rote) coding doesn’t cut it!
  11. 11. Our Problems Can we solve them with code generation?
  12. 12. Yes, we can!
  13. 13. Talking about Common Approaches to Advoid Redundancy #iphonical #iphonedevcon09
  14. 14. Wizards
  15. 15. Wizards in Practice Ruby on Rails AppLoop Xcode Project Templates
  16. 16. This wizard whips up a complete and running legacy application with just a single click.
  17. 17. Designers
  18. 18. Designers in Practice Graphical Designers Interface Core Builder Data
  19. 19. Interface Builder is no abstraction but another approach to object construction. Handwritten code is still needed.
  20. 20. Core Data produces code a developer can work with but overwrites handcrafted value.
  21. 21. Introducing Model-Driven Software Development #mdsd #iphonical #iphonedevcon09
  22. 22. Raise the level of abstraction where possible and generate code wisely.
  23. 23. One cannot abstract away everything. Manual code is great for all the special cases and details.
  24. 24. Use the best of both worlds at the same time.
  25. 25. Isn’t Core Data #mdsd? #iphonical #iphonedevcon09
  26. 26. Models Data Schema
  27. 27. Sophisticated Runtime
  28. 28. Demo
  29. 29. So, what’s # iPhonical about? #iphonedevcon09
  30. 30. View DSL View / GUI NIB Entity DSL ViewController ViewController Remote DSL Service DSL Transfomer ServiceFacades Mapper ORM / DAO RemoteClient Entities Messages Sqlite JSON HTTP Any ServerFacade RestService Server Server Entities Messages JBoss / RestEasy
  31. 31. Thoughts of an iPhone developer
  32. 32. View DSL View / GUI NIB Entity DSL Better Manually ViewController ViewController Remote DSL Service DSL What’s this? Transfomer ServiceFacades Mapper Core Data ORM / DAO Entities Framework Messages RemoteClient Sqlite JSON HTTP Any ServerFacade RestService Most likely Server Entities Server Messages legacy JBoss / RestEasy
  33. 33. Will now present Objective Resource or “iPhone on Rails” #iphonical #iphonedevcon09
  34. 34. Demo
  35. 35. Entities with Objective Resource #import "ObjectiveResource.h" #import "ObjectiveResource.h" #import "Dog.h" #import "Person.h" @interface Person : NSObject { @implementation Person ! NSString *personId; @synthesize personId; ! NSDate *updatedAt; @synthesize updatedAt; ! NSDate *createdAt; @synthesize createdAt; ! NSString *name; @synthesize name; } // handle pluralization @property (nonatomic, retain) NSString *personId; + (NSString *) getRemoteCollectionName { @property (nonatomic, retain) NSDate *updatedAt; ! return @"people"; @property (nonatomic, retain) NSDate *createdAt; } @property (nonatomic, retain) NSString *name; - (NSArray *) findAllDogs { // returns dogs ! return [Dog findRemote:[NSString stringWithFormat: - (NSArray *) findAllDogs; @"%@/dogs", personId, nil]]; - (NSArray *) findAllDogsWithResponse: (NSError * *) aError; } @end - (NSArray *) findAllDogsWithResponse: (NSError * *) aError { ! return [Dog findRemote:[NSString stringWithFormat: @"%@/dogs", personId, nil] withResponse: aError]; } - (void) dealloc { ! [personId release]; ! [updatedAt release]; ! [createdAt release]; ! [name release]; ! [super dealloc]; } @end
  36. 36. Real Information Content #import "ObjectiveResource.h" #import "ObjectiveResource.h" #import "Dog.h" #import "Person.h" @interface Person : NSObject { @implementation Person ! NSString *personId; @synthesize personId; ! NSDate *updatedAt; @synthesize updatedAt; ! NSDate *createdAt; @synthesize createdAt; ! NSString *name; @synthesize name; } // handle pluralization @property (nonatomic, retain) NSString *personId; + (NSString *) getRemoteCollectionName { @property (nonatomic, retain) NSDate *updatedAt; ! return @"people"; @property (nonatomic, retain) NSDate *createdAt; } @property (nonatomic, retain) NSString *name; - (NSArray *) findAllDogs { // returns dogs ! return [Dog findRemote:[NSString stringWithFormat: - (NSArray *) findAllDogs; @"%@/dogs", personId, nil]]; - (NSArray *) findAllDogsWithResponse: (NSError * *) aError; } @end - (NSArray *) findAllDogsWithResponse: (NSError * *) aError { ! return [Dog findRemote:[NSString stringWithFormat: @"%@/dogs", personId, nil] withResponse: aError]; } - (void) dealloc { ! [personId release]; ! [updatedAt release]; ! [createdAt release]; ! [name release]; ! [super dealloc]; } @end
  37. 37. Objective-C #ftl ? #iphonical #iphonedevcon09
  38. 38. Objective-C
  39. 39. Suppose...
  40. 40. You’d want to core an apple...
  41. 41. ... for your kids.
  42. 42. ? Right tool for the job
  43. 43. Your trusty swiss army knife!
  44. 44. Suppose...
  45. 45. You’d want to core a few more apples...
  46. 46. ... for an apple cake.
  47. 47. Still the best tool for the job?
  48. 48. Better use this one
  49. 49. ...and this one
  50. 50. ... a DSL is ...
  51. 51. A specific tool for a specific job
  52. 52. A specific tool for a specific job
  53. 53. Idea behind #iphonical : Use DSLs to describe the world #iphonedevcon09
  54. 54. ! ! entity Car { ! ! ! ! ! ! String name; ! ! ! ! ! ! String number; ! ! ! ! ! ! Integer km; ! ! ! ! ! ! JourneyEntry * journeys; ! ! }; ! ! ! ! ! ! ! ! entity JourneyEntry { ! ! ! ! Location startLocation; Entities ! ! ! ! ! ! Location endLocation; ! ! ! ! ! ! String comment; ! ! ! ! ! ! Integer startKm; ! ! ! ! ! ! Integer endKm; ! ! ! ! ! ! Car car; ! ! ! ! ! ! Driver driver; ! ! ! ! ! ! Reason reason; ! ! }; ! ! entity CarDataResponse { ! ! ! ! ! ! String creationDate; ! ! ! ! ! ! ! ! ! ! Car car; ! ! ! ! Location location; ! ! ! ! JourneyEntry journey; Services / Messages ! ! ! ! ! ! Driver driver; ! ! }; ! ! restService iDriveLogService "/idrivelogservice" { ! ! ! ! ! ! baseUrl "http://localhost:8080/iDriveLogRESTWebServices"; ! ! ! ! ! ! get data "/data" response:CarDataResponse; ! ! }; ! ! viewController Root { UI ! ! ! ! ! ! ui Label myLabel; ! ! ! ! ! ! ui Textfield myTextfield; ! ! ! ! ! ! action myAction; ! ! };
  55. 55. Leverage Entity DSL for Objective Resource
  56. 56. View / GUI Entity DSL ViewController Objective Resource Entities and Mapping JSON / HTTP Rails Application
  57. 57. Demo
  58. 58. Wait... #iPhonical works with any framework ? #iphonedevcon09
  59. 59. Demo of custom templates
  60. 60. #iPhonical: Where to get and its future #iphonedevcon09
  61. 61. Open source Apache License 2.0 code code.google.com/p/iphonical/ Currently 8 participants
  62. 62. What’s comming up? ! Publications in upcoming Eclipse Magazin ! ShowCase about Conferences ! Tighter integration with Xcode
  63. 63. twitter @HBehrens blog http://HeikoBehrens.net mail Heiko.Behrens@itemis.de xing http://www.xing.com/profile/Heiko_Behrens linkedin http://www.linkedin.com/in/HeikoBehrens code.google.com/p/iphonical

×