SlideShare a Scribd company logo
1 of 59
Download to read offline
Modellgetriebene App-Entwicklung
für iPhone und Android
Heiko Behrens, itemis
Regionalgruppe Hamburg der GI
Hamburg 24.09.2010
@HBehrens
http://mobile.itemis.de
Dienstag, 28. September 2010
Modellgetriebene App-Entwicklung
für iPhone und Android
Dienstag, 28. September 2010
Modellgetriebene App-Entwicklung
für iPhone und Android
Dienstag, 28. September 2010
/ 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.
Dienstag, 28. September 2010
Typical Situations
in
Software Development
Dienstag, 28. September 2010
Boring code
Dienstag, 28. September 2010
Accidental complexity
Dienstag, 28. September 2010
Wrong level of abstraction
Dienstag, 28. September 2010
Anatomy of Modern Software
schematic code (manually written)
Libraries
Frameworks
manually written
code
Dienstag, 28. September 2010
Dienstag, 28. September 2010
package templates;
import java.util.*;
import java.io.Serializable;
import javax.persistence.*;
@SuppressWarnings("serial")
@Entity
public class Customer implements Serializable {
	 private Long id;
	 private String name;
	 private Address address;
	 private Set<Order> orders = new HashSet<Order>();
	 // No-arg constructor
	 public Customer() {
	 }
	 @Id
	 public Long getId() {
	 	 return id;
	 }
	 public void setId(Long id) {
	 	 this.id = id;
	 }
	 public String getName() {
	 	 return name;
	 }
	 public void setName(String name) {
	 	 this.name = name;
	 }
	 public Address getAddress() {
	 	 return address;
	 }
	 public void setAddress(Address address) {
	 	 this.address = address;
	 }
	 @OneToMany
	 public Collection<Order> getOrders() {
	 	 return orders;
	 }
	 public void setOrders(Set<Order> orders) {
	 	 this.orders = orders;
	 }
}
Dienstag, 28. September 2010
package templates;
import java.io.Serializable;
import java.util.*;
import javax.persistence.*;
@SuppressWarnings("serial")
@Entity
public class Customer implements Serializable {
	 private Long id;
	 private String name;
	 private Address address;
	 private Set<Order> orders = new HashSet<Order>();
	 // No-arg constructor
	 public Customer() {
	 }
	 @Id
	 public Long getId() {
	 	 return id;
	 }
	 public void setId(Long id) {
	 	 this.id = id;
	 }
	 public String getName() {
	 	 return name;
	 }
	 public void setName(String name) {
	 	 this.name = name;
	 }
	 public Address getAddress() {
	 	 return address;
	 }
	 public void setAddress(Address address) {
	 	 this.address = address;
	 }
	 @OneToMany
	 public Collection<Order> getOrders() {
	 	 return orders;
	 }
	 public void setOrders(Set<Order> orders) {
	 	 this.orders = orders;
	 }
}
Dienstag, 28. September 2010
Common Approaches
to
Avoid Redundancy
Dienstag, 28. September 2010
Wizards
Dienstag, 28. September 2010
This wizard whips up a
complete and running
legacy application with
just a single click.
Dienstag, 28. September 2010
Designers
Dienstag, 28. September 2010
Model-Driven
Software Development
Dienstag, 28. September 2010
Raise the level
of abstraction
where possible
and generate
code wisely.
Dienstag, 28. September 2010
One cannot
abstract away
everything.
Manual code is
great for all the
special cases and
details.
Dienstag, 28. September 2010
Use the best of both worlds at the same time.
Dienstag, 28. September 2010
Dienstag, 28. September 2010
Suppose...
Dienstag, 28. September 2010
You’d want to core an apple...
Dienstag, 28. September 2010
... for your kids.
Dienstag, 28. September 2010
Right tool for the job
?
Dienstag, 28. September 2010
Your trusty swiss army knife!
Dienstag, 28. September 2010
Suppose...
Dienstag, 28. September 2010
You’d want to core a few more apples...
Dienstag, 28. September 2010
... for an apple cake.
Dienstag, 28. September 2010
Still the best tool for the job?
Dienstag, 28. September 2010
Better use this one
Dienstag, 28. September 2010
...and this one
Dienstag, 28. September 2010
... a DSL is ...
Dienstag, 28. September 2010
A specific tool
for a specific job
Dienstag, 28. September 2010
A specific tool
for a specific job
Dienstag, 28. September 2010
Use DSLs to describe the world
Dienstag, 28. September 2010
select name, salary
from employees
where salary > 2000
order by salary
^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$
Dienstag, 28. September 2010
http://mobl-lang.org/
http://code.google.com/p/iphonical/
http://code.google.com/p/applause/
applause
iPhonical
mobl
Dienstag, 28. September 2010
entity Vortrag {
	 String titel
	 String untertitel
	 String sprecher
	 String beschreibung
}
contentprovider AllVortragItems
	 returns Vortrag[]
	 fetches XML
	 	 from "http://spreadsheets.google.com/feeds/list/.../public/values"
	 	 selects "feed.entry"
tableview VortragListe(Vortrag[] items) {
	 title= "Vorträge"
	 section {
	 	 cell Subtitle foreach items as i {
	 	 	 text= i.titel
	 	 	 details= i.untertitel
	 	 	 action= VortragDetailsView( i )
	 	 }
	 }
}
tabbarApplication itemisApp {
	 button {
	 	 title= "Vorträge"
	 	 icon= "66-microphone.png"
	 	 view= VortragListe( AllVortragItems() )
	 }
	 button {
	 	 title= "Referenten"
	 	 icon= "person.png"
	 	 view= SprecherListe( AllSprecherItems() )
	 }
}
Entities & Data Access
Views & Actions
Navigation
Dienstag, 28. September 2010
... for building DSLs?
Why not use a DSL...
Dienstag, 28. September 2010
http://www.eclipse.org/Xtext/
@xtext
Dienstag, 28. September 2010
Superclass
Subclass Class
ECore meta model
LL(*) Parser Editor
Model
G
r
a
m
m
a
r
Generator
Runtime
Dienstag, 28. September 2010
Grammar (similar to EBNF)
grammar org.xtext.example.Entity with org.eclipse.xtext.common.Terminals
generate entity "http://www.xtext.org/example/Entity"
Model:
(types+=Type)*;
Type:
TypeDef | Entity;
TypeDef:
"typedef" name=ID ("mapsto" mappedType=JAVAID)?;
JAVAID:
name=ID("." ID)*;
Entity:
"entity" name=ID ("extends" superEntity=[Entity])?
"{"
(attributes+=Attribute)*
"}";
Attribute:
type=[Type] (many?="*")? name=ID;
Dienstag, 28. September 2010
grammar org.xtext.example.Entity
with org.eclipse.xtext.common.Terminals
generate entity
"http://www.xtext.org/example/Entity"
Model:
(types+=Type)*;
Type:
TypeDef | Entity;
TypeDef:
"typedef" name=ID
("mapsto" mappedType=JAVAID)?;
JAVAID:
name=ID("." ID)*;
Entity:
"entity" name=ID
("extends" superEntity=[Entity])?
"{"
(attributes+=Attribute)*
"}";
Attribute:
type=[Type] (many?="*")? name=ID;
entity
Model
*
name: EString
Type
types
TypeDef Entity
name: EString
JAVAID
superEntity
mappedType
name: EString
many: EBoolean
Attribute
attributes
type
Meta model inference
Dienstag, 28. September 2010
Let’s build a DSL
for Mobile Apps
Dienstag, 28. September 2010
Dienstag, 28. September 2010
Anatomy of an iPhone app
Table view
View title
Tab bar
Tab bar button
Name
Image
Speaker
Title
Location
Session
Entity
Data Provider
Table cell
Dienstag, 28. September 2010
Mapping concepts
Table view
View title
Table cell
Tab bar
Tab bar button
Entity
Data Provider
tabbarApplication itemisApp {
	 button {
	 	 title= "Blog"
	 	 icon= "08-chat.png"
	 	 view= BlogList( Blogposts() )
	 }
	 button {
	 	 title= "Talks"
	 	 icon= "66-microphone.png"
	 	 view= VortragListe( AllVortragItems() )
	 }
	 button {
	 	 title= "Speakers"
	 	 icon= "person.png"
	 	 view= SprecherListe( AllSprecherItems() )
	 }
}
Dienstag, 28. September 2010
Mapping concepts
Table view
View title
Table cell
Tab bar
Tab bar button
Entity
Data Provider
entity BlogItem {
	 String title
	 String author
	 String link
	 String description
	 String pubDate
	 BlogItem subItem
}
entity Sprecher {
	 String name
	 String beschreibung
	 String email
	 String blog
	 String fotourl
	 String vortraege
}
entity Vortrag {
	 String titel
	 String untertitel
	 String sprecher
	 String beschreibung
	 String zeit
	 Vortrag fortsetzung
}
Dienstag, 28. September 2010
Mapping concepts
Table view
View title
Table cell
Tab bar
Tab bar button
Entity
Data Provider
contentprovider Blogposts
	 returns BlogItem[]
	 fetches XML
	 	 from "http://blogs.itemis.de/?showfeed=1"
	 	 selects "rss.channel.item"
	
contentprovider AllVortragItems
	 returns Vortrag[]
	 fetches XML
	 	 from "http://spreadsheets.google.com/feeds/
list/0Au3-oaNYhfPIdEpRQWxpZnJyX2JCNUdtT1Z4M1B4SkE/1/
public/values"
	 	 selects "feed.entry"
Dienstag, 28. September 2010
Mapping concepts
Table view
View title
Table cell
Tab bar
Tab bar button
Entity
Data Provider tableview BlogList(BlogItem[] items) {
	 title= "itemis blog"
	 section {
	 	 cell Subtitle foreach items as i {
	 	 	 text= i.author
	 	 	 details= i.title
	 	 	 image= ("http://blogs.itemis.de/wp-content/
themes/itemis-WP-Theme/photos/" urlconform(i.author)
".jpg")
	 	 	 action= BlogDetails(i)
	 	 }
	 }
}
Dienstag, 28. September 2010
Type safe
Produces any
kind of text
Can run standalone
(ANT / Maven)
Debugger
Profiler
Eclipse-based
Editor
Protected regions
Cartridges
Outlets
Polymorphism
Dienstag, 28. September 2010
tableview SpeakerList(
Speaker[] speakers)
{
title= "Speakers"
section
{
cell Default foreach
speakers as speaker
{
text= speaker.name
image= speaker.smallImageURL
action= SpeakerDetails
(SpeakerById(
speaker.speakerId))
}
}
}
Mapping concepts to code
Dienstag, 28. September 2010
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
!
id item = [self.items objectAtIndex: indexPath.row];
!
UITableViewCell *cell =
[self cellDefaultForTableView:tableView];
cell.textLabel.text = [item valueForKeyPath:@"name"];
!
NSString *imageURL = [item valueForKeyPath:@"fotourl"];
cell.imageView.image = [self getImage: imageURL
withLoadingImage:@"personLoading.png"
andErrorImage:@"personUnknown.png"];
return cell;
}
Cell Rendering
Dienstag, 28. September 2010
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
!
id item = [self.items objectAtIndex: indexPath.row];
!
UITableViewCell *cell =
[self cellDefaultForTableView:tableView];
cell.textLabel.text = [item valueForKeyPath:@"name"];
!
NSString *imageURL = [item valueForKeyPath:@"fotourl"];
cell.imageView.image = [self getImage: imageURL
withLoadingImage:@"personLoading.png"
andErrorImage:@"personUnknown.png"];
return cell;
}
Cell Rendering
tableview SpeakerList(
Speaker[] speakers)
{
title= "Speakers"
section
{
cell Default foreach
speakers as speaker
{
text= speaker.name
image= speaker.smallImageURL
action= SpeakerDetails
(SpeakerById(
speaker.speakerId))
}
}
}
Dienstag, 28. September 2010
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
id item = [self.items objectAtIndex: indexPath.row];
IPContentProvider *provider =
[IPSimpleContentProvider providerWithContent:item
andProviders:self.contentProvider.providers];
SprecherDetailsViewController *controller =
[[SprecherDetailsViewController alloc] init];
controller.contentProvider = provider;
[self.navigationController pushViewController:
controller animated: TRUE];
[controller release];
}
User Interaction
tableview SpeakerList(
Speaker[] speakers)
{
title= "Speakers"
section
{
cell Default foreach
speakers as speaker
{
text= speaker.name
image= speaker.smallImageURL
action= SpeakerDetails
(SpeakerById(
speaker.speakerId))
}
}
}
Dienstag, 28. September 2010
tableview SpeakerList(
Speaker[] speakers)
{
title= "Speakers"
section
{
cell Default foreach
speakers as speaker
{
text= speaker.name
image= speaker.smallImageURL
action= SpeakerDetails
(SpeakerById(
speaker.speakerId))
}
}
}
«DEFINE viewModule FOR SectionedView»
«FILE filenameModule()»
#import "«filenameHeader()»"
#import "NSObject+Applause.h"
«EXPAND imports»
@implementation «className()»
«EXPAND sectionCount»
«EXPAND sectionTitleHeader»
«EXPAND rowCounts»
«EXPAND cellDescriptions»
«EXPAND cellSelections»
«EXPAND staticData»
@end
«ENDFILE»
«ENDDEFINE»
Template Invocation
Dienstag, 28. September 2010
Demo
Dienstag, 28. September 2010
@HBehrens
http://HeikoBehrens.net
mobile.itemis.de
eclipse.org
code.google.com/p/applause
twitter
blog
consulting
Xtext/Xpand
applause
Dienstag, 28. September 2010

More Related Content

What's hot

Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful weddingStéphane Wirtel
 
Implementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with SlickImplementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with SlickHermann Hueck
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲームNoritada Shimizu
 
Psycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptPsycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptSurvey Department
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksBruno Rocha
 
Data visualization by Kenneth Odoh
Data visualization by Kenneth OdohData visualization by Kenneth Odoh
Data visualization by Kenneth Odohpyconfi
 
Using Scala Slick at FortyTwo
Using Scala Slick at FortyTwoUsing Scala Slick at FortyTwo
Using Scala Slick at FortyTwoEishay Smith
 
Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreNicolas Carlo
 
6. Generics. Collections. Streams
6. Generics. Collections. Streams6. Generics. Collections. Streams
6. Generics. Collections. StreamsDEVTYPE
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecturezefhemel
 
Data Types and Processing in ES6
Data Types and Processing in ES6Data Types and Processing in ES6
Data Types and Processing in ES6m0bz
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomerzefhemel
 
RIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSRIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSDominik Jungowski
 
JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashBret Little
 
NOTEPAD MAKING IN PAYTHON BY ROHIT MALAV
NOTEPAD  MAKING IN PAYTHON BY ROHIT MALAVNOTEPAD  MAKING IN PAYTHON BY ROHIT MALAV
NOTEPAD MAKING IN PAYTHON BY ROHIT MALAVRohit malav
 

What's hot (20)

Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful wedding
 
Implementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with SlickImplementing a many-to-many Relationship with Slick
Implementing a many-to-many Relationship with Slick
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲーム
 
Psycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python ScriptPsycopg2 - Connect to PostgreSQL using Python Script
Psycopg2 - Connect to PostgreSQL using Python Script
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
 
Data visualization by Kenneth Odoh
Data visualization by Kenneth OdohData visualization by Kenneth Odoh
Data visualization by Kenneth Odoh
 
Using Scala Slick at FortyTwo
Using Scala Slick at FortyTwoUsing Scala Slick at FortyTwo
Using Scala Slick at FortyTwo
 
Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscore
 
6. Generics. Collections. Streams
6. Generics. Collections. Streams6. Generics. Collections. Streams
6. Generics. Collections. Streams
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
mobl
moblmobl
mobl
 
Lodash js
Lodash jsLodash js
Lodash js
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecture
 
Data Types and Processing in ES6
Data Types and Processing in ES6Data Types and Processing in ES6
Data Types and Processing in ES6
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
 
RIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSRIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JS
 
JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and Lodash
 
NOTEPAD MAKING IN PAYTHON BY ROHIT MALAV
NOTEPAD  MAKING IN PAYTHON BY ROHIT MALAVNOTEPAD  MAKING IN PAYTHON BY ROHIT MALAV
NOTEPAD MAKING IN PAYTHON BY ROHIT MALAV
 

Similar to MDSD for iPhone and Android

C# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesC# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesSami Mut
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniquesjoaopmaia
 
C# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesC# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesSami Mut
 
IAT334-Lab02-ArraysPImage.pptx
IAT334-Lab02-ArraysPImage.pptxIAT334-Lab02-ArraysPImage.pptx
IAT334-Lab02-ArraysPImage.pptxssuseraae9cd
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + SpringBryan Hsueh
 
It's complicated, but it doesn't have to be: a Dagger journey
It's complicated, but it doesn't have to be: a Dagger journeyIt's complicated, but it doesn't have to be: a Dagger journey
It's complicated, but it doesn't have to be: a Dagger journeyThiago “Fred” Porciúncula
 
Best Practices in Ext GWT
Best Practices in Ext GWTBest Practices in Ext GWT
Best Practices in Ext GWTSencha
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Djangokenluck2001
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
iPhone for .NET Developers
iPhone for .NET DevelopersiPhone for .NET Developers
iPhone for .NET DevelopersBen Scheirman
 
Django tech-talk
Django tech-talkDjango tech-talk
Django tech-talkdtdannen
 

Similar to MDSD for iPhone and Android (20)

Android best practices
Android best practicesAndroid best practices
Android best practices
 
C# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesC# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slides
 
C programming slide c02
C programming slide c02C programming slide c02
C programming slide c02
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
Blossom Q&A Webinar
Blossom Q&A WebinarBlossom Q&A Webinar
Blossom Q&A Webinar
 
C# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesC# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slides
 
29. Treffen - Tobias Meier - TypeScript
29. Treffen - Tobias Meier - TypeScript29. Treffen - Tobias Meier - TypeScript
29. Treffen - Tobias Meier - TypeScript
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
IAT334-Lab02-ArraysPImage.pptx
IAT334-Lab02-ArraysPImage.pptxIAT334-Lab02-ArraysPImage.pptx
IAT334-Lab02-ArraysPImage.pptx
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
 
It's complicated, but it doesn't have to be: a Dagger journey
It's complicated, but it doesn't have to be: a Dagger journeyIt's complicated, but it doesn't have to be: a Dagger journey
It's complicated, but it doesn't have to be: a Dagger journey
 
Best Practices in Ext GWT
Best Practices in Ext GWTBest Practices in Ext GWT
Best Practices in Ext GWT
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
iPhone for .NET Developers
iPhone for .NET DevelopersiPhone for .NET Developers
iPhone for .NET Developers
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Django tech-talk
Django tech-talkDjango tech-talk
Django tech-talk
 
Html 4
Html   4Html   4
Html 4
 
Html 4
Html   4Html   4
Html 4
 

More from Heiko Behrens

Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Heiko Behrens
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010Heiko Behrens
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneHeiko Behrens
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Heiko Behrens
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Heiko Behrens
 
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGMastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGHeiko Behrens
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannHeiko Behrens
 

More from Heiko Behrens (8)

Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhone
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009
 
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGMastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kann
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

MDSD for iPhone and Android

  • 1. Modellgetriebene App-Entwicklung für iPhone und Android Heiko Behrens, itemis Regionalgruppe Hamburg der GI Hamburg 24.09.2010 @HBehrens http://mobile.itemis.de Dienstag, 28. September 2010
  • 2. Modellgetriebene App-Entwicklung für iPhone und Android Dienstag, 28. September 2010
  • 3. Modellgetriebene App-Entwicklung für iPhone und Android Dienstag, 28. September 2010
  • 4. / 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. Dienstag, 28. September 2010
  • 6. Boring code Dienstag, 28. September 2010
  • 8. Wrong level of abstraction Dienstag, 28. September 2010
  • 9. Anatomy of Modern Software schematic code (manually written) Libraries Frameworks manually written code Dienstag, 28. September 2010
  • 11. package templates; import java.util.*; import java.io.Serializable; import javax.persistence.*; @SuppressWarnings("serial") @Entity public class Customer implements Serializable { private Long id; private String name; private Address address; private Set<Order> orders = new HashSet<Order>(); // No-arg constructor public Customer() { } @Id public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @OneToMany public Collection<Order> getOrders() { return orders; } public void setOrders(Set<Order> orders) { this.orders = orders; } } Dienstag, 28. September 2010
  • 12. package templates; import java.io.Serializable; import java.util.*; import javax.persistence.*; @SuppressWarnings("serial") @Entity public class Customer implements Serializable { private Long id; private String name; private Address address; private Set<Order> orders = new HashSet<Order>(); // No-arg constructor public Customer() { } @Id public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @OneToMany public Collection<Order> getOrders() { return orders; } public void setOrders(Set<Order> orders) { this.orders = orders; } } Dienstag, 28. September 2010
  • 15. This wizard whips up a complete and running legacy application with just a single click. Dienstag, 28. September 2010
  • 18. Raise the level of abstraction where possible and generate code wisely. Dienstag, 28. September 2010
  • 19. One cannot abstract away everything. Manual code is great for all the special cases and details. Dienstag, 28. September 2010
  • 20. Use the best of both worlds at the same time. Dienstag, 28. September 2010
  • 23. You’d want to core an apple... Dienstag, 28. September 2010
  • 24. ... for your kids. Dienstag, 28. September 2010
  • 25. Right tool for the job ? Dienstag, 28. September 2010
  • 26. Your trusty swiss army knife! Dienstag, 28. September 2010
  • 28. You’d want to core a few more apples... Dienstag, 28. September 2010
  • 29. ... for an apple cake. Dienstag, 28. September 2010
  • 30. Still the best tool for the job? Dienstag, 28. September 2010
  • 31. Better use this one Dienstag, 28. September 2010
  • 32. ...and this one Dienstag, 28. September 2010
  • 33. ... a DSL is ... Dienstag, 28. September 2010
  • 34. A specific tool for a specific job Dienstag, 28. September 2010
  • 35. A specific tool for a specific job Dienstag, 28. September 2010
  • 36. Use DSLs to describe the world Dienstag, 28. September 2010
  • 37. select name, salary from employees where salary > 2000 order by salary ^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$ Dienstag, 28. September 2010
  • 39. entity Vortrag { String titel String untertitel String sprecher String beschreibung } contentprovider AllVortragItems returns Vortrag[] fetches XML from "http://spreadsheets.google.com/feeds/list/.../public/values" selects "feed.entry" tableview VortragListe(Vortrag[] items) { title= "Vorträge" section { cell Subtitle foreach items as i { text= i.titel details= i.untertitel action= VortragDetailsView( i ) } } } tabbarApplication itemisApp { button { title= "Vorträge" icon= "66-microphone.png" view= VortragListe( AllVortragItems() ) } button { title= "Referenten" icon= "person.png" view= SprecherListe( AllSprecherItems() ) } } Entities & Data Access Views & Actions Navigation Dienstag, 28. September 2010
  • 40. ... for building DSLs? Why not use a DSL... Dienstag, 28. September 2010
  • 42. Superclass Subclass Class ECore meta model LL(*) Parser Editor Model G r a m m a r Generator Runtime Dienstag, 28. September 2010
  • 43. Grammar (similar to EBNF) grammar org.xtext.example.Entity with org.eclipse.xtext.common.Terminals generate entity "http://www.xtext.org/example/Entity" Model: (types+=Type)*; Type: TypeDef | Entity; TypeDef: "typedef" name=ID ("mapsto" mappedType=JAVAID)?; JAVAID: name=ID("." ID)*; Entity: "entity" name=ID ("extends" superEntity=[Entity])? "{" (attributes+=Attribute)* "}"; Attribute: type=[Type] (many?="*")? name=ID; Dienstag, 28. September 2010
  • 44. grammar org.xtext.example.Entity with org.eclipse.xtext.common.Terminals generate entity "http://www.xtext.org/example/Entity" Model: (types+=Type)*; Type: TypeDef | Entity; TypeDef: "typedef" name=ID ("mapsto" mappedType=JAVAID)?; JAVAID: name=ID("." ID)*; Entity: "entity" name=ID ("extends" superEntity=[Entity])? "{" (attributes+=Attribute)* "}"; Attribute: type=[Type] (many?="*")? name=ID; entity Model * name: EString Type types TypeDef Entity name: EString JAVAID superEntity mappedType name: EString many: EBoolean Attribute attributes type Meta model inference Dienstag, 28. September 2010
  • 45. Let’s build a DSL for Mobile Apps Dienstag, 28. September 2010
  • 47. Anatomy of an iPhone app Table view View title Tab bar Tab bar button Name Image Speaker Title Location Session Entity Data Provider Table cell Dienstag, 28. September 2010
  • 48. Mapping concepts Table view View title Table cell Tab bar Tab bar button Entity Data Provider tabbarApplication itemisApp { button { title= "Blog" icon= "08-chat.png" view= BlogList( Blogposts() ) } button { title= "Talks" icon= "66-microphone.png" view= VortragListe( AllVortragItems() ) } button { title= "Speakers" icon= "person.png" view= SprecherListe( AllSprecherItems() ) } } Dienstag, 28. September 2010
  • 49. Mapping concepts Table view View title Table cell Tab bar Tab bar button Entity Data Provider entity BlogItem { String title String author String link String description String pubDate BlogItem subItem } entity Sprecher { String name String beschreibung String email String blog String fotourl String vortraege } entity Vortrag { String titel String untertitel String sprecher String beschreibung String zeit Vortrag fortsetzung } Dienstag, 28. September 2010
  • 50. Mapping concepts Table view View title Table cell Tab bar Tab bar button Entity Data Provider contentprovider Blogposts returns BlogItem[] fetches XML from "http://blogs.itemis.de/?showfeed=1" selects "rss.channel.item" contentprovider AllVortragItems returns Vortrag[] fetches XML from "http://spreadsheets.google.com/feeds/ list/0Au3-oaNYhfPIdEpRQWxpZnJyX2JCNUdtT1Z4M1B4SkE/1/ public/values" selects "feed.entry" Dienstag, 28. September 2010
  • 51. Mapping concepts Table view View title Table cell Tab bar Tab bar button Entity Data Provider tableview BlogList(BlogItem[] items) { title= "itemis blog" section { cell Subtitle foreach items as i { text= i.author details= i.title image= ("http://blogs.itemis.de/wp-content/ themes/itemis-WP-Theme/photos/" urlconform(i.author) ".jpg") action= BlogDetails(i) } } } Dienstag, 28. September 2010
  • 52. Type safe Produces any kind of text Can run standalone (ANT / Maven) Debugger Profiler Eclipse-based Editor Protected regions Cartridges Outlets Polymorphism Dienstag, 28. September 2010
  • 53. tableview SpeakerList( Speaker[] speakers) { title= "Speakers" section { cell Default foreach speakers as speaker { text= speaker.name image= speaker.smallImageURL action= SpeakerDetails (SpeakerById( speaker.speakerId)) } } } Mapping concepts to code Dienstag, 28. September 2010
  • 54. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ! id item = [self.items objectAtIndex: indexPath.row]; ! UITableViewCell *cell = [self cellDefaultForTableView:tableView]; cell.textLabel.text = [item valueForKeyPath:@"name"]; ! NSString *imageURL = [item valueForKeyPath:@"fotourl"]; cell.imageView.image = [self getImage: imageURL withLoadingImage:@"personLoading.png" andErrorImage:@"personUnknown.png"]; return cell; } Cell Rendering Dienstag, 28. September 2010
  • 55. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ! id item = [self.items objectAtIndex: indexPath.row]; ! UITableViewCell *cell = [self cellDefaultForTableView:tableView]; cell.textLabel.text = [item valueForKeyPath:@"name"]; ! NSString *imageURL = [item valueForKeyPath:@"fotourl"]; cell.imageView.image = [self getImage: imageURL withLoadingImage:@"personLoading.png" andErrorImage:@"personUnknown.png"]; return cell; } Cell Rendering tableview SpeakerList( Speaker[] speakers) { title= "Speakers" section { cell Default foreach speakers as speaker { text= speaker.name image= speaker.smallImageURL action= SpeakerDetails (SpeakerById( speaker.speakerId)) } } } Dienstag, 28. September 2010
  • 56. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { id item = [self.items objectAtIndex: indexPath.row]; IPContentProvider *provider = [IPSimpleContentProvider providerWithContent:item andProviders:self.contentProvider.providers]; SprecherDetailsViewController *controller = [[SprecherDetailsViewController alloc] init]; controller.contentProvider = provider; [self.navigationController pushViewController: controller animated: TRUE]; [controller release]; } User Interaction tableview SpeakerList( Speaker[] speakers) { title= "Speakers" section { cell Default foreach speakers as speaker { text= speaker.name image= speaker.smallImageURL action= SpeakerDetails (SpeakerById( speaker.speakerId)) } } } Dienstag, 28. September 2010
  • 57. tableview SpeakerList( Speaker[] speakers) { title= "Speakers" section { cell Default foreach speakers as speaker { text= speaker.name image= speaker.smallImageURL action= SpeakerDetails (SpeakerById( speaker.speakerId)) } } } «DEFINE viewModule FOR SectionedView» «FILE filenameModule()» #import "«filenameHeader()»" #import "NSObject+Applause.h" «EXPAND imports» @implementation «className()» «EXPAND sectionCount» «EXPAND sectionTitleHeader» «EXPAND rowCounts» «EXPAND cellDescriptions» «EXPAND cellSelections» «EXPAND staticData» @end «ENDFILE» «ENDDEFINE» Template Invocation Dienstag, 28. September 2010