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