iPhonical and model-driven software development for the iPhone
Upcoming SlideShare
Loading in...5
×
 

iPhonical and model-driven software development for the iPhone

on

  • 3,504 views

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 ...

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.

Statistics

Views

Total Views
3,504
Views on SlideShare
3,488
Embed Views
16

Actions

Likes
7
Downloads
80
Comments
0

3 Embeds 16

http://www.slideshare.net 12
http://lanyrd.com 3
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

iPhonical and model-driven software development for the iPhone iPhonical and model-driven software development for the iPhone Presentation Transcript

  • iPhonicalSoftware Development and Model-Driven Heiko Behrens (itemis) backchannel via #iphonical #iphonedevcon09
  • / 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.
  • Sketching some Typical Situations in Software Development #iphonical #iphonedevcon09
  • Boring code
  • Accidental complexity
  • Wrong level of abstraction
  • Anatomy of Modern Software Software artifact
  • Anatomy of Modern Software manually written code Frameworks Libraries
  • Anatomy of Modern Software manually written code Frameworks schematic code (manually written) Libraries
  • (rote) coding doesn’t cut it!
  • Our Problems Can we solve them with code generation?
  • Yes, we can!
  • Talking about Common Approaches to Advoid Redundancy #iphonical #iphonedevcon09
  • Wizards
  • Wizards in Practice Ruby on Rails AppLoop Xcode Project Templates
  • This wizard whips up a complete and running legacy application with just a single click.
  • Designers
  • Designers in Practice Graphical Designers Interface Core Builder Data
  • Interface Builder is no abstraction but another approach to object construction. Handwritten code is still needed.
  • Core Data produces code a developer can work with but overwrites handcrafted value.
  • Introducing Model-Driven Software Development #mdsd #iphonical #iphonedevcon09
  • Raise the level of abstraction where possible and generate code wisely.
  • One cannot abstract away everything. Manual code is great for all the special cases and details.
  • Use the best of both worlds at the same time.
  • Isn’t Core Data #mdsd? #iphonical #iphonedevcon09
  • Models Data Schema
  • Sophisticated Runtime
  • Demo
  • So, what’s # iPhonical about? #iphonedevcon09
  • 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
  • Thoughts of an iPhone developer
  • 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
  • Will now present Objective Resource or “iPhone on Rails” #iphonical #iphonedevcon09
  • Demo
  • 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
  • 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
  • Objective-C #ftl ? #iphonical #iphonedevcon09
  • Objective-C
  • Suppose...
  • You’d want to core an apple...
  • ... for your kids.
  • ? Right tool for the job
  • Your trusty swiss army knife!
  • Suppose...
  • You’d want to core a few more apples...
  • ... for an apple cake.
  • Still the best tool for the job?
  • Better use this one
  • ...and this one
  • ... a DSL is ...
  • A specific tool for a specific job
  • A specific tool for a specific job
  • Idea behind #iphonical : Use DSLs to describe the world #iphonedevcon09
  • ! ! 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; ! ! };
  • Leverage Entity DSL for Objective Resource
  • View / GUI Entity DSL ViewController Objective Resource Entities and Mapping JSON / HTTP Rails Application
  • Demo
  • Wait... #iPhonical works with any framework ? #iphonedevcon09
  • Demo of custom templates
  • #iPhonical: Where to get and its future #iphonedevcon09
  • Open source Apache License 2.0 code code.google.com/p/iphonical/ Currently 8 participants
  • What’s comming up? ! Publications in upcoming Eclipse Magazin ! ShowCase about Conferences ! Tighter integration with Xcode
  • 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