Once CODE to rule them all
Upcoming SlideShare
Loading in...5
×
 

Once CODE to rule them all

on

  • 2,528 views

DSLs in Mobile application development, using XText and Applause framework as example.

DSLs in Mobile application development, using XText and Applause framework as example.

Statistics

Views

Total Views
2,528
Views on SlideShare
2,528
Embed Views
0

Actions

Likes
0
Downloads
24
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • RAMP: Virtual Mobile Technologies\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • MWE2: Modeling workflow engine 2\ntextual approach much easier to implement & use than GUI\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Specification: DSL done in-house, build of native app from that outsourced\n
  • \n
  • \n

Once CODE to rule them all Once CODE to rule them all Presentation Transcript

  • One CODE to rule them allDSLs and Mobile App Developmentpresented by Herman Lintvelt
  • Agenda• Challenges in Mobile App development• Possible Solutions• Introducing Domain Specific Languages (DSL) • What & Why• Applause Framework • XText • Example: SASSI Pocketguide App• Next steps
  • Poll What is the biggest frustration you have whendeveloping mobile applications for smartphones?
  • Challenges in Mobile App Development Can we have it for BlackBerry too?
  • Challenges in Mobile App DevelopmentDo we really have to do this again?
  • Multi-platform Challenge• For a while iPhone was “the one and only”• Increasingly clients want to roll out apps to multiple smart phone platforms (Android, Blackberry)• BUT • Clients do not necessarily want to pay extra full cost for each platform • It’s boring and inefficient to duplicate effort for each platform
  • Possibilities• Numerous frameworks / tools out there to help develop mobile apps for multiple platforms: • PhoneGap, Appcelerator, RAMP, Rhomobile, J2ME Polish, etc.• Does have drawbacks: • limited functionality: cannot access all the functionality of each mobile platform • for some: web-driven content (constant use of expensive bandwidth)
  • Towards a CODE solution
  • Manually written code Frameworks Libraries
  • Manually written app code Manually written schematic/scaffolding code Frameworks Libraries
  • Scenario 1: Develop same app for multiple platforms Manually written app code Manually written app code Manually written Manually written schematic/scaffolding code schematic/scaffolding code iOS Frameworks Android Frameworks iOS Libraries Android Libraries iOS Android
  • Scenario 2: Develop second app on same platform Manually written app code Manually written schematic/scaffolding code iOS App One iOS Frameworks iOS Libraries Manually written app code Manually written schematic/scaffolding code iOS App Two iOS Frameworks iOS Libraries
  • Scenario 3: Multiple apps for multiple platforms Manually written app code Manually written app code Manually written Manually written schematic/scaffolding code schematic/scaffolding codeApp One iOS Frameworks Android Frameworks iOS Libraries Android Libraries Manually written app code Manually written app code Manually written Manually written schematic/scaffolding code schematic/scaffolding codeApp Two iOS Frameworks Android Frameworks iOS Libraries Android Libraries
  • What’s wrong with this picture? • Repetition, Repetition, Repetition • Mostly Manual • Accidental Complexity • UI code is difficult
  • What If?
  • What If?We code each app ONCE
  • What If? We code each app ONCE ANDWe have control over the native code
  • What If? We code each app ONCE AND We have control over the native code ANDExperience gained with each app enhances overall quality of native code
  • Scenario 3: Multiple apps for multiple platforms Manually written app codeApp One iOS Generated app code Android Generated app code iOS Scaffolding code Android Scaffolding code iOS Frameworks Android Frameworks iOS Libraries Android LibrariesApp Two Manually written app code
  • IntroducingDomain Specific Languages (DSL)
  • What is a DSL?• Programming/Specification language dedicated to specific problem domain • e.g. Logo, Mathematica, SQL, regular expressions, GraphViz, XSLT, Business Rules Engines, UnrealScript, Lua• Java, Objective-C: general purpose languages
  • Why use a DSL?• allows solutions to be expressed more clearly & closer to domain• enhances understanding and communication• allows validation at domain level• self-documenting
  • Mobile App DSL• It is possible to define a DSL for the Mobile application domain• Examples: • RAMP uses a custom DSL • Applause (now applitude)
  • Introducing the ApplauseFramework
  • What is it?• “(XText) DSL for creating mobile apps”• Use code generation (via XPand) to generate for multiple platforms (iOS and Android)DSL Manually written app GeneratediOS Generated app Android Generated app code iOS Scaffolding code Android code Scaffolding code iOS Android Frameworks Frameworks iOS Libraries Android Libraries
  • Applause Background• Developed by Heiko Behrens, Peter Friese • from Itemis AG (www.itemis.com)• http://code.google.com/applause• Reworked into: applitude • http://applitude.org/• Makes use of XText and Xpand Eclipse projects
  • XText : Quick Intro• language development framework for DSL (or even full-blown GPL)• http://www.eclipse.org/XText• creates Eclipse-based development environment for your DSL• it provides way (i.e. its own DSL) to describe your language, then gives: • parser • type-safe abstract syntax tree (AST) • serializer • code formatter • scoping, linking, compiler checks, validation • code generator or interpreter • Eclipse IDE for your language• Highly configurable (using Google Guice)
  • Explore by Example• SASSI Pocket Guide app (wwfsassi.co.za)
  • First we need some data• Google Docs to the rescue
  • App Anatomy iPhone 10:15 PM View Title SASSI Pocket Guide Fish A IMG Note Table View IMG Fish B Note Fish IMG Fish C Table Cell Note FishName status Fish D note IMG Note IMG Fish E Note IMG Fish F Note IMG Fish G Note Fish HEntity IMG Note Tab Bar All Green Orange Red Data Provider Tab Bar Button
  • Mapping concepts Entity Data Provider View Title Table View Table Cell Tab Bar Tab Bar Button
  • Mapping concepts Entity Data Provider View Title Table View Table Cell Tab Bar Tab Bar Button
  • Mapping concepts Entity Data Provider View Title Table View Table Cell Tab Bar Tab Bar Button
  • Mapping concepts Entity Data Provider View Title Table View Table Cell Tab Bar Tab Bar Button
  • The flow of things Applause DSL iOS Code Generation templates
  • The flow of things Generated iOS Application Code
  • The flow of things iPhone 10:15 PM SASSI Pocket Guide IMG Fish A Note IMG Fish B Note IMG Fish C Note IMG Fish D Note IMG Fish E Note IMG Fish F Note IMG Fish G Note IMG Fish H Note All Green Orange Red
  • Retrospective• Did this give us what we want?• Inspect & Adapt • enhance scaffolding templates • enhance DSL
  • Next Steps• Investigate iPhonical • http://code.google.com/p/iphonical/• Also XText based (similar to Applause)• Currently focussed on CRUD-based apps• Generate Titanium Mobile javascript (i.e. Appcelerator do multi-platform abstraction)
  • Next Steps• DSL for your business domain • Differentiate between enterprise business domain and the business of building apps for various clients • e.g. Car Telematics DSL vs. Applause DSL• Other uses? • Specification (BDD?) • Testing
  • iOS User Group Cape Town• Please email me: herman@polymorph.co.za • Indicate if you want to: • a) help organise • b) just want to attend
  • Thanks• Thanks for attending• Feel free to email me at: • herman@polymorph.co.za• Have fun creating your own coding language