SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Models To Go
                          Peter Friese, itemis
                         Heiko Behrens, itemis

                   @peterfriese | @HBehrens
                        @itemismobile
                    http://mobile.itemis.de

                           (c) 2010 Heiko Behrens & Peter Friese
More info: http://www.heikobehrens.net / http://www.peterfriese.de / http://mobile.itemis.com
mobile is sexy
mobile is challenging
diversity of platforms
94 App Stores
two categories
countless devices
How can we address
  this diversity?
You can write amazing web apps
that look exactly and behave
exactly like apps on the iPhone
                  Steve Jobs, WWDC 2007
MOBILE WEB
server-side web                             client-side web


                                                Web Browser
                  Web Server
               executes application
                      logic
                                                 JavaScript
                                           executes application logic
Web Browser




              Files             Database
                                             Files         Database




  Device              Backend                        Device             Backend
hybrid app

Native App

         Interpreter



    Request
   Interceptor


         JavaScript Bridge

          Browser
     executes JavaScript




             Device                Backend
interpreted app

Native App

         interpreter




                  Database
  Application
    Script
                       Files




             Device             Backend
generated app

    Generator




 Generator Input       Native App

                               Logic     Logic
      Model
describes logic and
                             Database   Database
 complete system

                                Files    Files
Files     Database

                              Device    Backend
gain speed
    through restrictions
Lists   Details   Custom
analyzing the problem




http://www.flickr.com/photos/minifig/3174009125/
Anatomy
of these apps
View




      Speaker
  Name
  Image

        Session
  Title
  Location                        Cells




Entity
                                  Navigation
                  Data Provider
demo
getting real
tabbarApplication itemisApp {
	 button {
	 	 title= "Tuesday"
	 	 icon= "calendar.png"
	 	 view= SessionList( SessionsByDay("0") )
	 }

	   button {
	   	 title= "Wednesday"
	   	 icon= "calendar.png"
	   	 view= SessionList( SessionsByDay("1") )
	   }
	
	   button {
	   	 title= "Thursday"
	   	 icon= "calendar.png"
	   	 view= SessionList( SessionsByDay("2") )
	   }
	
	   button {
	   	 title= "Speakers"
	   	 icon= "person.png"
	   	 view= SpeakersList( AllSpeakers() )
	   }
}
tabbarApplication itemisApp {
	 button {
	 	 title= "Tuesday"
	 	 icon= "calendar.png"
	 	 view= SessionList( SessionsByDay("0") )
	 }

	   button {
	   	 title= "Wednesday"
	   	 icon= "calendar.png"
	   	 view= SessionList( SessionsByDay("1") )
	   }
	
	   button {
	   	 title= "Thursday"
	   	 icon= "calendar.png"
	   	 view= SessionList( SessionsByDay("2") )
	   }
	
	   button {
	   	 title= "Speakers"
	   	 icon= "person.png"
	   	 view= SpeakersList( AllSpeakers() )
	   }
}
-(UIViewController*)createController {
!    itemisAppProviders *providers = [[[itemisAppProviders alloc] init] autorelease];
!    UITabBarController *result = [[UITabBarController alloc] init];
!    NSMutableArray *controllers = [NSMutableArray array];
!
!    UIViewController<IPUIView> *controller;
!    UINavigationController *navController;
!    IPContentProvider *contentProvider;

!   // controller for @"Tuesday"
!   contentProvider = [providers providerForSessionsByDay: @"0"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Tuesday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Wednesday"
!   contentProvider = [providers providerForSessionsByDay: @"1"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Wednesday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Thursday"
!   contentProvider = [providers providerForSessionsByDay: @"2"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Thursday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Speakers"
!   contentProvider = [providers providerForAllSpeakers];
!
!   controller = [[SpeakersListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Speakers";
!   controller.tabBarItem.image = [UIImage imageNamed:@"person.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];


!   result.viewControllers = controllers;
!   return result;
}
-(UIViewController*)createController {
!    itemisAppProviders *providers = [[[itemisAppProviders alloc] init] autorelease];
!    UITabBarController *result = [[UITabBarController alloc] init];
!    NSMutableArray *controllers = [NSMutableArray array];
!
!    UIViewController<IPUIView> *controller;
!    UINavigationController *navController;
!    IPContentProvider *contentProvider;

!   // controller for @"Tuesday"
!   contentProvider = [providers providerForSessionsByDay: @"0"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Tuesday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Wednesday"
!   contentProvider = [providers providerForSessionsByDay: @"1"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Wednesday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Thursday"
!   contentProvider = [providers providerForSessionsByDay: @"2"];
!
!   controller = [[SessionListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Thursday";
!   controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];

!
!   // controller for @"Speakers"
!   contentProvider = [providers providerForAllSpeakers];
!
!   controller = [[SpeakersListViewController alloc] init];
!   [controller setContentProvider: contentProvider];
!   controller.tabBarItem.title = @"Speakers";
!   controller.tabBarItem.image = [UIImage imageNamed:@"person.png"];
!   navController = [[UINavigationController alloc] initWithRootViewController:controller];
!   [controllers addObject: navController];
!   [controller release];
!   [navController release];


!   result.viewControllers = controllers;
!   return result;
}
«Xpand»
«DEFINE moduleFile FOR Application»
«FILE filenameApplicationDelegateModule()»
#import "«filenameApplicationDelegateHeader()»"
#import "IPUIView.h"
#import "«filenameCentralProvidersHeader()»"

«EXPAND importStatements-»

@implementation «applicationDelegateClassname()»

@synthesize window, rootController;

-(UIViewController*)createController {
	    «centralProvidersClassName()» *providers = [[[«centralProvidersClassName()» alloc] init] autorelease];
	    UITabBarController *result = [[UITabBarController alloc] init];
	    NSMutableArray *controllers = [NSMutableArray array];
	
	    UIViewController<IPUIView> *controller;
	    UINavigationController *navController;
	    IPContentProvider *contentProvider;

«EXPAND barControllerInstance FOREACH buttons»

	   result.viewControllers = controllers;
	   return result;
}

- (void)applicationDidFinishLaunching:(UIApplication *)application {
	    self.rootController = [self createController];
	    [window addSubview: [self.rootController view]];
    [window makeKeyAndVisible];
}

- (void)dealloc {
	    self.rootController = nil;
    [window release];
    [super dealloc];
}



@end
«ENDFILE»
«ENDDEFINE»
«DEFINE moduleFile FOR Application»
«FILE filenameApplicationDelegateModule()»
#import "«filenameApplicationDelegateHeader()»"
#import "IPUIView.h"
#import "«filenameCentralProvidersHeader()»"

«EXPAND importStatements-»

@implementation «applicationDelegateClassname()»

@synthesize window, rootController;

-(UIViewController*)createController {
	    «centralProvidersClassName()» *providers = [[[«centralProvidersClassName()» alloc] init] autorelease];
	    UITabBarController *result = [[UITabBarController alloc] init];
	    NSMutableArray *controllers = [NSMutableArray array];
	
	    UIViewController<IPUIView> *controller;
	    UINavigationController *navController;
	    IPContentProvider *contentProvider;

«EXPAND barControllerInstance FOREACH buttons»

	   result.viewControllers = controllers;
	   return result;
}

- (void)applicationDidFinishLaunching:(UIApplication *)application {
	    self.rootController = [self createController];
	    [window addSubview: [self.rootController view]];
    [window makeKeyAndVisible];
}

- (void)dealloc {
	    self.rootController = nil;
    [window release];
    [super dealloc];
}



@end
«ENDFILE»
«ENDDEFINE»
«DEFINE barControllerInstance FOR TabbarButton»
	 «IF view.provider != null»
	 // controller for «this.title.expression('', '')»
	 contentProvider = «view.provider.contentProvider('providers', '', '')»;
	 «ENDIF»
	 controller = [[«view.view.className()» alloc] init];
	 [controller setContentProvider: contentProvider];
	 controller.tabBarItem.title = «title.expression('', '')»;
	 controller.tabBarItem.image = [UIImage imageNamed:«this.icon.expression('','')»];
	 navController = [[UINavigationController alloc] initWithRootViewController:controller];
	 [controllers addObject: navController];
	 [controller release];
	 [navController release];
«ENDDEFINE»
tool integration
demo 2
developer’s point of view

                                      Simulator


                        Objective-C


                                       Device



        DSL
describes application




                                      Simulator


                           Java


                                        Device
toolsmith’s point of view

                           «Xpand»
                 Parser
                              Templates   Templates
                                iPhone     Android
   Grammar
                 Editor
 describes DSL

                          EMF MM
APPlause
                                     applause

                                                                                            Simulator



                           «Xpand»
                                                                              Objective-C


                                                                                             Device
                 Parser
                              Templates   Templates
                                iPhone     Android
  Grammar
                 Editor                                       DSL
describes DSL                                         describes application

                          EMF MM


                                                                                            Simulator


                                                                                 Java


                                                                                              Device




                http://code.google.com/p/applause/
http://mobile.itemis.de

@peterfriese | http://peterfriese.de
@hbehrens |!http://heikobehrens.net

Contenu connexe

Plus de Peter Friese

Plus de Peter Friese (20)

Building Reusable SwiftUI Components
Building Reusable SwiftUI ComponentsBuilding Reusable SwiftUI Components
Building Reusable SwiftUI Components
 
Firebase for Apple Developers - SwiftHeroes
Firebase for Apple Developers - SwiftHeroesFirebase for Apple Developers - SwiftHeroes
Firebase for Apple Developers - SwiftHeroes
 
 +  = ❤️ (Firebase for Apple Developers) at Swift Leeds
 +  = ❤️ (Firebase for Apple Developers) at Swift Leeds +  = ❤️ (Firebase for Apple Developers) at Swift Leeds
 +  = ❤️ (Firebase for Apple Developers) at Swift Leeds
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 
Firebase for Apple Developers
Firebase for Apple DevelopersFirebase for Apple Developers
Firebase for Apple Developers
 
Building Apps with SwiftUI and Firebase
Building Apps with SwiftUI and FirebaseBuilding Apps with SwiftUI and Firebase
Building Apps with SwiftUI and Firebase
 
Rapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and FirebaseRapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and Firebase
 
Rapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and FirebaseRapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and Firebase
 
6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth6 Things You Didn't Know About Firebase Auth
6 Things You Didn't Know About Firebase Auth
 
Five Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase AuthFive Things You Didn't Know About Firebase Auth
Five Things You Didn't Know About Firebase Auth
 
Building High-Quality Apps for Google Assistant
Building High-Quality Apps for Google AssistantBuilding High-Quality Apps for Google Assistant
Building High-Quality Apps for Google Assistant
 
Building Conversational Experiences with Actions on Google
Building Conversational Experiences with Actions on Google Building Conversational Experiences with Actions on Google
Building Conversational Experiences with Actions on Google
 
Building Conversational Experiences with Actions on Google
Building Conversational Experiences with Actions on GoogleBuilding Conversational Experiences with Actions on Google
Building Conversational Experiences with Actions on Google
 
What's new in Android Wear 2.0
What's new in Android Wear 2.0What's new in Android Wear 2.0
What's new in Android Wear 2.0
 
Google Fit, Android Wear & Xamarin
Google Fit, Android Wear & XamarinGoogle Fit, Android Wear & Xamarin
Google Fit, Android Wear & Xamarin
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Google Play Services Rock
Google Play Services RockGoogle Play Services Rock
Google Play Services Rock
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Google+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and AndroidGoogle+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and Android
 
Cross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-InCross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-In
 

Dernier

Dernier (20)

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...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Models To Go: How We Built a DSL for Mobile Apps With Tools From the Eclipse Modeling Project

  • 1. Models To Go Peter Friese, itemis Heiko Behrens, itemis @peterfriese | @HBehrens @itemismobile http://mobile.itemis.de (c) 2010 Heiko Behrens & Peter Friese More info: http://www.heikobehrens.net / http://www.peterfriese.de / http://mobile.itemis.com
  • 8. How can we address this diversity?
  • 9. You can write amazing web apps that look exactly and behave exactly like apps on the iPhone Steve Jobs, WWDC 2007
  • 11. server-side web client-side web Web Browser Web Server executes application logic JavaScript executes application logic Web Browser Files Database Files Database Device Backend Device Backend
  • 12. hybrid app Native App Interpreter Request Interceptor JavaScript Bridge Browser executes JavaScript Device Backend
  • 13. interpreted app Native App interpreter Database Application Script Files Device Backend
  • 14. generated app Generator Generator Input Native App Logic Logic Model describes logic and Database Database complete system Files Files Files Database Device Backend
  • 15. gain speed through restrictions
  • 16.
  • 17.
  • 18. Lists Details Custom
  • 21. View Speaker Name Image Session Title Location Cells Entity Navigation Data Provider
  • 22.
  • 23. demo
  • 25. tabbarApplication itemisApp { button { title= "Tuesday" icon= "calendar.png" view= SessionList( SessionsByDay("0") ) } button { title= "Wednesday" icon= "calendar.png" view= SessionList( SessionsByDay("1") ) } button { title= "Thursday" icon= "calendar.png" view= SessionList( SessionsByDay("2") ) } button { title= "Speakers" icon= "person.png" view= SpeakersList( AllSpeakers() ) } }
  • 26. tabbarApplication itemisApp { button { title= "Tuesday" icon= "calendar.png" view= SessionList( SessionsByDay("0") ) } button { title= "Wednesday" icon= "calendar.png" view= SessionList( SessionsByDay("1") ) } button { title= "Thursday" icon= "calendar.png" view= SessionList( SessionsByDay("2") ) } button { title= "Speakers" icon= "person.png" view= SpeakersList( AllSpeakers() ) } }
  • 27. -(UIViewController*)createController { ! itemisAppProviders *providers = [[[itemisAppProviders alloc] init] autorelease]; ! UITabBarController *result = [[UITabBarController alloc] init]; ! NSMutableArray *controllers = [NSMutableArray array]; ! ! UIViewController<IPUIView> *controller; ! UINavigationController *navController; ! IPContentProvider *contentProvider; ! // controller for @"Tuesday" ! contentProvider = [providers providerForSessionsByDay: @"0"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Tuesday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Wednesday" ! contentProvider = [providers providerForSessionsByDay: @"1"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Wednesday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Thursday" ! contentProvider = [providers providerForSessionsByDay: @"2"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Thursday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Speakers" ! contentProvider = [providers providerForAllSpeakers]; ! ! controller = [[SpeakersListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Speakers"; ! controller.tabBarItem.image = [UIImage imageNamed:@"person.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! result.viewControllers = controllers; ! return result; }
  • 28. -(UIViewController*)createController { ! itemisAppProviders *providers = [[[itemisAppProviders alloc] init] autorelease]; ! UITabBarController *result = [[UITabBarController alloc] init]; ! NSMutableArray *controllers = [NSMutableArray array]; ! ! UIViewController<IPUIView> *controller; ! UINavigationController *navController; ! IPContentProvider *contentProvider; ! // controller for @"Tuesday" ! contentProvider = [providers providerForSessionsByDay: @"0"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Tuesday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Wednesday" ! contentProvider = [providers providerForSessionsByDay: @"1"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Wednesday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Thursday" ! contentProvider = [providers providerForSessionsByDay: @"2"]; ! ! controller = [[SessionListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Thursday"; ! controller.tabBarItem.image = [UIImage imageNamed:@"calendar.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! ! // controller for @"Speakers" ! contentProvider = [providers providerForAllSpeakers]; ! ! controller = [[SpeakersListViewController alloc] init]; ! [controller setContentProvider: contentProvider]; ! controller.tabBarItem.title = @"Speakers"; ! controller.tabBarItem.image = [UIImage imageNamed:@"person.png"]; ! navController = [[UINavigationController alloc] initWithRootViewController:controller]; ! [controllers addObject: navController]; ! [controller release]; ! [navController release]; ! result.viewControllers = controllers; ! return result; }
  • 30. «DEFINE moduleFile FOR Application» «FILE filenameApplicationDelegateModule()» #import "«filenameApplicationDelegateHeader()»" #import "IPUIView.h" #import "«filenameCentralProvidersHeader()»" «EXPAND importStatements-» @implementation «applicationDelegateClassname()» @synthesize window, rootController; -(UIViewController*)createController { «centralProvidersClassName()» *providers = [[[«centralProvidersClassName()» alloc] init] autorelease]; UITabBarController *result = [[UITabBarController alloc] init]; NSMutableArray *controllers = [NSMutableArray array]; UIViewController<IPUIView> *controller; UINavigationController *navController; IPContentProvider *contentProvider; «EXPAND barControllerInstance FOREACH buttons» result.viewControllers = controllers; return result; } - (void)applicationDidFinishLaunching:(UIApplication *)application { self.rootController = [self createController]; [window addSubview: [self.rootController view]]; [window makeKeyAndVisible]; } - (void)dealloc { self.rootController = nil; [window release]; [super dealloc]; } @end «ENDFILE» «ENDDEFINE»
  • 31. «DEFINE moduleFile FOR Application» «FILE filenameApplicationDelegateModule()» #import "«filenameApplicationDelegateHeader()»" #import "IPUIView.h" #import "«filenameCentralProvidersHeader()»" «EXPAND importStatements-» @implementation «applicationDelegateClassname()» @synthesize window, rootController; -(UIViewController*)createController { «centralProvidersClassName()» *providers = [[[«centralProvidersClassName()» alloc] init] autorelease]; UITabBarController *result = [[UITabBarController alloc] init]; NSMutableArray *controllers = [NSMutableArray array]; UIViewController<IPUIView> *controller; UINavigationController *navController; IPContentProvider *contentProvider; «EXPAND barControllerInstance FOREACH buttons» result.viewControllers = controllers; return result; } - (void)applicationDidFinishLaunching:(UIApplication *)application { self.rootController = [self createController]; [window addSubview: [self.rootController view]]; [window makeKeyAndVisible]; } - (void)dealloc { self.rootController = nil; [window release]; [super dealloc]; } @end «ENDFILE» «ENDDEFINE»
  • 32. «DEFINE barControllerInstance FOR TabbarButton» «IF view.provider != null» // controller for «this.title.expression('', '')» contentProvider = «view.provider.contentProvider('providers', '', '')»; «ENDIF» controller = [[«view.view.className()» alloc] init]; [controller setContentProvider: contentProvider]; controller.tabBarItem.title = «title.expression('', '')»; controller.tabBarItem.image = [UIImage imageNamed:«this.icon.expression('','')»]; navController = [[UINavigationController alloc] initWithRootViewController:controller]; [controllers addObject: navController]; [controller release]; [navController release]; «ENDDEFINE»
  • 35. developer’s point of view Simulator Objective-C Device DSL describes application Simulator Java Device
  • 36. toolsmith’s point of view «Xpand» Parser Templates Templates iPhone Android Grammar Editor describes DSL EMF MM
  • 37. APPlause applause Simulator «Xpand» Objective-C Device Parser Templates Templates iPhone Android Grammar Editor DSL describes DSL describes application EMF MM Simulator Java Device http://code.google.com/p/applause/
  • 38.