240 likes | 366 Views
OdinTools – A Visual Language for Cross-Platform Mobile Service Development. Andrew Meads amea020@aucklanduni.ac.nz. Overview. Review of Odin (feel free to ask questions!) Challenge: Platform Heterogeneity Existing Solutions Our Solution: OdinTools Aside: Domain-Specific Visual Languages
E N D
OdinTools – A Visual Language for Cross-Platform Mobile Service Development Andrew Meads amea020@aucklanduni.ac.nz
Overview • Review of Odin (feel free to ask questions!) • Challenge: Platform Heterogeneity • Existing Solutions • Our Solution: OdinTools • Aside: Domain-Specific Visual Languages • Aside: Model-Driven Engineering • OdinTools Architecture • Use Case: A Patient Monitoring System • Current & Future Work, Conclusions
Review:Mobile Services Context
Reachability Scalability Review: Challenges Mobility Reachability = Scalability Availability
Review: Odin Middleware Context- Awareness Vertical Handover Surrogate Migration Client Transparency
Platform Heterogeneity • Many different mobile platforms today • Android, iOS, Windows Phone 7, Blackberry… • How to free developers from writing multiple versions of their services? package com.example.helloandroid;import android.app.Activity;import android.os.Bundle;publicclassHelloAndroidextendsActivity{/** Called when the activity is first created. */@Overridepublicvoid onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState); setContentView(R.layout.main);}} - (void)applicationDidFinishLaunching:(UIApplication *)application { // Create window self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Set up content view self.contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; [window addSubview:contentView]; // Show window [window makeKeyAndVisible]; UITextField *textView = [[UITextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; [contentView addSubview:textView]; [textView setText:@"Hello World"]; [textView release]; }
Existing Solutions • XMLVM • Android apps bytecode XML “stack machine emulator” on target platform • Scripting languages with native additions • Commercial tools available: Titanium, ELIPS Studio • Extensive middleware support • Cross-compile to binaries with extensive compatibility APIs • “Manual Transformation” • i.e. pay someone else to do it!
Summary & Critique • Current solutions are great for traditional mobile apps: • Graphically intensive • Clients, as opposed to servers • Background, multithreaded, computationally intensive tasks are less well supported • To develop Odin services using an existing solution, we’d have to implement the entire middleware using a scripting language X_X • How about we borrow some ideas from Service-Oriented Architecture tools?
OdinTools • Domain-Specific Visual Language for mobile service specification. • Built upon the foundations of Model-Driven Engineering to provide cross-platform capabilities. • Written using a combination of Marama Meta-Tools, Java, and Eclipse Modeling Framework (EMF).
Domain-Specific Languages • A Domain-Specific Language (DSL) is: • “A programming language or specification language dedicated to a particular problem domain, representation technique, and / or solution technique” (Wikipedia, May 2011 ) • In widespread use today. • Can be visual, text-based, or model-based (or commonly, some combination of these).
Domain-Specific Languages • Everyday examples: • Shell scripts • Markup Languages (e.g. HTML, ColdFusion) • Maths & Statistical Modelling tools (e.g. R, S, Maxima) • Verilog, VHDL • Generic Eclipse Modelling System • Graphing tools (e.g. GraphViz, GrGen) • Template Engines • Etc...
Why Use a DSL? • Can simplify the task of creating a solution to a problem in that domain • Can present a shallow learning curve for people with domain knowledge • Can help provide or enhance some of the “~ilities” – namely, reliability, maintainability, portability, reusability – by automatically addressing these concerns and allowing developers to work on the problem at hand
Relevant Examples • DSL’s have been used in the areas of mobile development and service-oriented architecture. fun(Bs,Qs,S) letrec main(S)=widget(Main) {image=Bs.main}{play()=levels(S)}; levels(S)=widget(Levels) {level=S.level;image=Bs.levels} {menu()=main(S);level()=level(S,S.level)}; level(S,level)=widget(Level) {level=level;image=exp.Nth(Bs.level,level)} {play()=play(S,level);back()=levels(S)}; play(S,level)=widget(Play) {question=nth(nth(Qs,level),nth(S.Qis,level))} letis=S.Qisin leti=nth(is,level) in{answer()=play(S.Qis:=(is[level]:=i+1,level)); timeout()=main(S)} inmain(S)
Model-Driven Engineering • Model-Driven Architecture (Object Management Group)
OdinTools Model Hierarchy • Model-Driven Architecture • (Object Management Group) • OdinTools Model Hierarchy Service Developer writes this Automatically Generated Platform Developer writes this Automatically Generated
OdinTools Model – Service Model Operation ContextSource ServiceBinding Property Binding Instance Collection Service DataType • Service Model (SM) • Service business logic and UI modelled • Odin Model (OM) • Shows how service is implemented using Odin middleware • Platform Independent Model (PIM) • Shows how Odin is implemented on an abstract platform • Platform Specific Model (PSM) • Shows how the abstract platform is realized on a concrete mobile device • Implementation • Generated code and deployment instructions
OdinTools Model – Odin Model Binding Instance DataType ContextSource Service • Service Model (SM) • Service business logic and UI modelled • Odin Model (OM) • Shows how service is implemented using Odin middleware Messaging • Platform Independent Model (PIM) • Shows how Odin is implemented on an abstract platform • Platform Specific Model (PSM) • Shows how the abstract platform is realized on a concrete mobile device • Implementation Surrogate Device • Generated code and deployment instructions
OdinTools Model - PIM View Activity BackgroundService ContentProvider • Service Model (SM) Messaging • Service business logic and UI modelled • Odin Model (OM) • Shows how service is implemented using Odin middleware • Platform Independent Model (PIM) • Shows how Odin is implemented on an abstract platform • Platform Specific Model (PSM) Device • Shows how the abstract platform is realized on a concrete mobile device • Implementation • Generated code and deployment instructions
OdinTools Model – PSM & Code • Service Model (SM) • Platform Specific Model should model a concrete platform • Currently, Android platform has been modelled • PSM model elements correspond to “real-world” artefacts – e.g. classes, methods • Service business logic and UI modelled • Odin Model (OM) • Shows how service is implemented using Odin middleware • Platform Independent Model (PIM) • Shows how Odin is implemented on an abstract platform • Platform Specific Model (PSM) • Shows how the abstract platform is realized on a concrete mobile device • Implementation • Generated code and deployment instructions
Visual Language • OdinTools development environment written in Marama • Developed at the University of Auckland • Allows rapid prototyping of Eclipse-based DSVLs • Using OdinTools, developers drag shapes onto a canvas representing data, services, context informaion, and bindings. OdinTools then automatically generates Eclipse projects for the Device and Surrogate.
Example: A Patient Monitoring System userID=user.id Return user.location Return user.heartRate
Current Progress & Future Work • Current progress: • Service Model specified • Odin Model specified • Platform-Specific Model and Code Generation for Android platform underway • Platform-Specific Model for iPhone underway • Future work: • Validate correctness and usability • Improve / fix based on feedback from evaluation • Allow third parties to specify additional PSM’s.