Desktop, Web and Mobile: Learn one get two for free · • OTIS® – Oil Trading and Information...
Transcript of Desktop, Web and Mobile: Learn one get two for free · • OTIS® – Oil Trading and Information...
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Desktop, Web and Mobile: Learn one get two for free
EclipseCon Europe - 25. October 2012 Schubartsaal 11:30 - 12:00
Rabea Gransberger Holger Wolf @rgransberger @klonkk
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Content of this talk
• Evolution from RCP to RAP and Tabris
• The domain we are working on
• Our software OTIS and its architecture
• Advantages, challenges of single-sourcing
• Demo of the OTIS RCP, RAP and Tabris clients
• Time for your questions
2
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Vocabulary
• Desktop: RCP (Eclipse Rich Client Platform) – SWT/JFace, multi-window, drag&drop etc. – Windows, Linux (x86, x86_64, PPC64, s390x,
s390/GTK 2), Solaris 10 (SPARC, x86/GTK 2), HP-UX (IA64_32/GTK 2), AIX (PPC, PPC64/GTK 2), Mac OSX (Mac/Cocoa/x86_64)
• Web: RAP (Eclipse Remote Application Platform) – Translates SWT/JFace widgets to HTML5/AJAX – Runs on HTML5/AJAX enabled Web Browsers
• Mobile: Tabris ['tæbris]
– Framework which renders SWT/JFace widgets as native iOS and Android widgets
– iOS, Android, AJAX enabled Web Browsers
3
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
The domain
4
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
The domain
• Self-Service petrol stations
• Customer has fuel-cards for the petrol stations
• Usage of fuel-card generates transaction which is received by OTIS software
• Transactions are invoiced in regular time intervals
• Invoices are send to customers
5
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
OTIS Software
• OTIS® – Oil Trading and Information System
• 2007
– Started internal development for one customer
– RCP based user interface for petrol station owners
• 2010
– Sold to the second customer
• 2011
– RAP base interface for fuel card users since
• 2012
– Sold to the third customer
– Mobile interface for petrol station owners in beta version
6
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
OTIS RCP
7
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
OTIS Software
• OTIS® – Oil Trading and Information System
• 2007
– Started internal development for one customer
– RCP based user interface for petrol station owners
• 2010
– Sold to the second customer
• 2011
– RAP based interface for fuel card users
• 2012
– Sold to the third customer
– Mobile interface for petrol station owners in beta version
8
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
RAP Customer Portal
9
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
OTIS Software
• OTIS® – Oil Trading and Information System
• 2007
– Started internal development for one customer
– RCP based user interface for petrol station owners
• 2010
– Sold to the second customer
• 2011
– RAP based interface for fuel card users
• 2012
– Sold to the third customer
– Mobile interface for petrol station owners in beta version
10
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Setup
• Three target platforms Three workspaces
• Most plugin projects are shared
• Additional plugins for each platform
• OTIS has 128 plugins with 350k lines of code
11
RCP
Tabris
RAP
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Advantages
• Using three frameworks from the same technology stack
– Learn one, get two for free
• Modern web UI with no AJAX knowledge
• iOS and Android clients without ObjectiveC and Android SDK
• Same code base
– No rewriting and business rule duplication
• Customer gets solutions faster
• Fast startup times and debugging support for Jetty webserver in development
• RAP + Tabris will support more features from RCP over time
12
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Challenges
• What to move where?
• New Services/Extension Points for splitted plugins and missing features
• No Eclipse UI for Tabris
13
de.mekos.otis.customer
de.mekos.otis.customer de.mekos.otis.customer.ui
de.mekos.otis.customer de.mekos.otis.customer.jui de.mekos.otis.customer.ui
• Model • Database • Logic
• SWT • JFace
• org.eclipse.ui (commands, menu, views)
Old
Refactored
Tabris
RCP, RAP
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Challenges
• I18n issues for RAP
• Access errors for split-packages at runtime on package visibility
• Missing dependency in exported product
• Circularity Error: plugin A starts plugin B and plugin B references class from plugin A
• Wrong Activator is used to load a resource
• But: Refactoring reduces coupling and makes code more readable and maintainable
14
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Demo
• RCP: OTIS Demo Application
• RAP: OTIS Customer Portal
• Tabris: Demo on iPad
• Changing code in the shared project will result in a visible change on all platforms
15
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Demo
16
Tabris: iPad Tabris: Android
RCP RAP
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Best Practice
• Divide plugins in UI and model part
– For Tabris: A third part without org.eclipse.ui dependencies
– Keep the content of views in Composites (Tabris has no views)
• Regularly check if all code compiles and runs on all platforms
• Create RCP and RAP dummy projects for classes which are not available on the other platform
• Wrap platform specific plugins (org.eclipse.ui, org.eclipse.rap.ui) as optional dependencies in one plugin and re-export them
17
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Thank you for attending our talk!
Any Questions… ??
18
Rabea Gransberger (@rgransberger) Holger Wolf (@klonkk)
Lise-Meitner-Str. 6 · 28359 Bremen · Tel. +49 421-38890-0 · Fax +49 421-38890-19 · www.meko-s.de · [email protected]
Additional Material
• OTIS: www.meko-s.de/otis
• RCP, RAP, Tabris: http://developer.eclipsesource.com/
• Single Sourcing with RAP and RCP: http://developer.eclipsesource.com/tutorials/SingleSourcingRAPSlides
• Single Sourcing Best Practices: http://eclipsesource.com/en/info/rcp-rap-single-sourcing-guideline
• RAP demos on: http://www.eclipse.org/rap/demos/
• Tabris Demo Android Client available in Play Store
19