Your SlideShare is downloading. ×
0
Using OSGi to Build Better SoftwareLessons from a Telemedicine Software for Smartphones andDesktop SystemsDoreen Seider (D...
Outline  What software did we want to have?  How did we develop it with OSGi?  What did we learn?                         ...
Slide 3ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
What kind of software did we want to have?                                                                                ...
Telemonitoring Software  Supports remote monitoring of patients (e.g. in rural areas)  Captures vital sign of patients fro...
In Comparison to That: Flexible TelemonitoringSoftware                                                                    ...
Flexible Telemonitoring Software Technology              Plug&Care Connector                                              ...
Plug&Care ConnectorRequirements1.   Both on smartphones (like Android or Windows Mobile) and on desktop     system executa...
How did we develop it with OSGi?                                                                                          ...
Plug&Care Connector‘s Architecture                                                                                        ...
OSGi Principles: Bundles and Services  OSGi is specification of a modular service platform written in Java  „modular“     ...
OSGi Principles: Bundles and Services  By default bundles are totally encapsulated  Bundles can make use of each other by ...
OSGi Principles: Bundles and Services  OSGi is specification of a modular service platform written in Java  „service“     ...
OSGi Principles: Bundles and Services                                                                                     ...
OSGi Principles: Bundles and Services  Service definition and implementation are separated to each other  No direct implem...
OSGi Principles: Bundles and Services                                                                                     ...
OSGi Principles: Declarative Services (DS)  OSGi Runtime calls the bundle and not other way around                        ...
OSGi Principles: Declarative Services (DS)  Bundles provide a set of so called component descriptions  A component is a Ja...
OSGi Principles: Declarative Services (DS)  Benefits of Declarative Services       Less complexity in own code       Bette...
Fulfilling Requirements with the help of OSGi1.   Both on smartphones (like Android or Windows Mobile) and on desktop     ...
Used OSGi Implementations: Equinox  For desktop  Eclipse Software Foundation  OSGi implementation under Eclipse  Decision ...
Used OSGi Implementations: mBS Mobile  For Smartphones  ProSyst company (http://prosyst.com)  Android, Windows Mobile, Nok...
Used OSGi Implementations: mBS MobileIntegration in Android                                                               ...
Used OSGi Implementations: mBS MobileOSGi Management on Android                                                           ...
Used OSGi Implementations: mBS MobileOSGi Applications on Android                                                         ...
OSGi-Stack: mBS MobileDevelopment Environment in Eclipse                                                                  ...
OSGi-Stack: mBS MobileDevelopment Environment in Eclipse                                                                  ...
Designing Plug&Care ConnectorAbstraction with the use of Console   OSGi comes with a console for management purposes   It ...
Designing Plug&Care ConnectorAbstraction with the use of Console   Layered architecture of affected bundles               ...
Designing Plug&Care ConnectorAbstraction with the use of Device Communication   Measurements are captured via Bluetooth   ...
Designing Plug&Care ConnectorAbstraction with the use of Device Communication   Layered architecture of affected bundles  ...
Designing Plug&Care ConnectorAbstraction with the use of Console and Device Communication   Deployment                    ...
Fulfilling Requirements with the help of OSGi1.   Both on smartphones (like Android or Windows Mobile) and on desktop     ...
Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver   How did we realize it?             ...
Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver                                      ...
Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver   What does a driver developer need t...
Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver   What does the Plug&Care Connecor do...
Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver   What does OSGi do?   Everything els...
What did we learn?                                                                                          Slide 44      ...
What did We Learn?Living out OSGi principles is a good base for building better software (interms of maintance and deploym...
Living out OSGi PrinciplesServices   Use services   Seperate service interface and service implementation   Allows abstrac...
Living out OSGi PrinciplesDeclarative Services   Prerequisite is usage of services   Make use of dependency injection   Le...
Living out OSGi PrinciplesEncapsulation   Make only those code public which is really intended to be public   Hide as much...
Slide 49ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
Upcoming SlideShare
Loading in...5
×

Using OSGi to Build Better Software

2,687

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,687
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
26
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Using OSGi to Build Better Software"

  1. 1. Using OSGi to Build Better SoftwareLessons from a Telemedicine Software for Smartphones andDesktop SystemsDoreen Seider (DLR - German Aerospace Center)ApacheCon NA 2011 (Vancouver, 11/11/2011) Slide 1 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  2. 2. Outline What software did we want to have? How did we develop it with OSGi? What did we learn? Slide 2 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  3. 3. Slide 3ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  4. 4. What kind of software did we want to have? Slide 4 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  5. 5. Telemonitoring Software Supports remote monitoring of patients (e.g. in rural areas) Captures vital sign of patients from medical devices Sends measurements to doctors sitting in a medical service center Executable on mobile devices and desktop systems Supports any kind of medical device and medical service center Slide 5 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  6. 6. In Comparison to That: Flexible TelemonitoringSoftware Slide 8 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  7. 7. Flexible Telemonitoring Software Technology Plug&Care Connector Slide 9 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  8. 8. Plug&Care ConnectorRequirements1. Both on smartphones (like Android or Windows Mobile) and on desktop system executable2. Support of any device and service center – even later on – without modification of the Plug&Care Connector Slide 10 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  9. 9. How did we develop it with OSGi? Slide 11 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  10. 10. Plug&Care Connector‘s Architecture Slide 12 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  11. 11. OSGi Principles: Bundles and Services OSGi is specification of a modular service platform written in Java „modular“ It is a module layer above the Java package layer Classes are assembled to packages  packages are assembled to bundles (modules)  bundles are assembled to applications Slide 13 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  12. 12. OSGi Principles: Bundles and Services By default bundles are totally encapsulated Bundles can make use of each other by explicit exports and imports of packages Slide 14 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  13. 13. OSGi Principles: Bundles and Services OSGi is specification of a modular service platform written in Java „service“ In a perfect world bundles make use of each other via services Eliminates direct dependencies to each others implementation Slide 15 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  14. 14. OSGi Principles: Bundles and Services Slide 16 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  15. 15. OSGi Principles: Bundles and Services Service definition and implementation are separated to each other No direct implementation dependencies Enables loose coupling Important for assembling bundles (jars) to applications Slide 17 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  16. 16. OSGi Principles: Bundles and Services Slide 18 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  17. 17. OSGi Principles: Declarative Services (DS) OSGi Runtime calls the bundle and not other way around Slide 19 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  18. 18. OSGi Principles: Declarative Services (DS) Bundles provide a set of so called component descriptions A component is a Java class Each describes which services a component provides and consumes OSGi runtime injects all required services at start up Slide 20 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  19. 19. OSGi Principles: Declarative Services (DS) Benefits of Declarative Services Less complexity in own code Better testing (no mock up of OSGi runtime needed) Slide 21 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  20. 20. Fulfilling Requirements with the help of OSGi1. Both on smartphones (like Android or Windows Mobile) and on desktop system executable Platform independency by realizating it as OSGi application OSGi serves as an abstraction layer of underlying diversity Using different implementations of OSGi for different platforms Assembling bundles to the Plug&Care Connector application according to its deployment platform Slide 22 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  21. 21. Used OSGi Implementations: Equinox For desktop Eclipse Software Foundation OSGi implementation under Eclipse Decision was made due to experiences from other software we develop Slide 23 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  22. 22. Used OSGi Implementations: mBS Mobile For Smartphones ProSyst company (http://prosyst.com) Android, Windows Mobile, Nokia S60 http://dz.prosyst.com/mbsmobile/ Decision was made due to supported platforms at that time and due to development status Slide 24 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  23. 23. Used OSGi Implementations: mBS MobileIntegration in Android Slide 25 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  24. 24. Used OSGi Implementations: mBS MobileOSGi Management on Android Slide 26 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  25. 25. Used OSGi Implementations: mBS MobileOSGi Applications on Android Slide 27 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  26. 26. OSGi-Stack: mBS MobileDevelopment Environment in Eclipse Slide 28 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  27. 27. OSGi-Stack: mBS MobileDevelopment Environment in Eclipse Slide 29 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  28. 28. Designing Plug&Care ConnectorAbstraction with the use of Console OSGi comes with a console for management purposes It is useful for testing i.e. interacting with the application if no GUI is available yet Own commands can be provided Different OSGi implementations might have different console APIs Abstraction of console APIs is needed to hide them for the underlying application layers writing to the console Slide 30 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  29. 29. Designing Plug&Care ConnectorAbstraction with the use of Console Layered architecture of affected bundles Slide 31 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  30. 30. Designing Plug&Care ConnectorAbstraction with the use of Device Communication Measurements are captured via Bluetooth There are different bluetooth implementations on different devices Later on not only Bluetooth, but USB should be supported as well Abstraction of communication layer and Bluetooth implementations is needed to ensure driver implemenentation must not be changed Slide 32 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  31. 31. Designing Plug&Care ConnectorAbstraction with the use of Device Communication Layered architecture of affected bundles Slide 33 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  32. 32. Designing Plug&Care ConnectorAbstraction with the use of Console and Device Communication Deployment Slide 34 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  33. 33. Fulfilling Requirements with the help of OSGi1. Both on smartphones (like Android or Windows Mobile) and on desktop system executable Platform independency by realizating it as OSGi application OSGi serves as an abstraction layer of underlying diversity Using different implementations for different platforms2. Support of any device and service center – even later on – without modification of the Plug&Care Connector Establish plugin concept Get plugins with help of modularity of OSGi Handle plugins (registration) by the use of dependency injection provided by OSGi (Declarative Services) Slide 35 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  34. 34. Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver How did we realize it? Slide 37 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  35. 35. Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver Slide 38 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  36. 36. Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver What does a driver developer need to do? Implement the driver interfaces provided by Plug&Care Connector Provide a component description like that:<component name=„Driver A“> <implementation class="de.pncc.plugins.drivers.DriverA"/> <service> <provide interface="de.pncc.drivers.Driver"/> </service></component> Slide 39 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  37. 37. Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver What does the Plug&Care Connecor do? Provides component description like that:<component name=„Driver Registry„ <reference name="de.pncc.driver„ interface="de.pncc.drivers.Driver„ bind="addDriver„ unbind="removeDriver</component> Implements bind and unbind method to e.g., store the driver in a list Slide 40 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  38. 38. Designing Plug&Care ConnectorPlugin and Registry Concept using the Example of Driver What does OSGi do? Everything else like listen to new driver bundles, retrieving there provided driver services, inject them to the right place, handles uninstalled driver bundles, … Slide 41 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  39. 39. What did we learn? Slide 44 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  40. 40. What did We Learn?Living out OSGi principles is a good base for building better software (interms of maintance and deployment). Slide 45 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  41. 41. Living out OSGi PrinciplesServices Use services Seperate service interface and service implementation Allows abstraction and loose coupling Makes application More robust against changes Deployable in different environments just by assempling different kind of jar files Slide 46 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  42. 42. Living out OSGi PrinciplesDeclarative Services Prerequisite is usage of services Make use of dependency injection Let other maintain the code for dependency handling Get your code free from OSGi API Makes application Easier to test by injecting stub or mock objects More robust because fewer lines of code (every reduced line of code, reduces the chance for a bug) Easier to understand and use by third party developers knowing nothing about OSGi Slide 47 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  43. 43. Living out OSGi PrinciplesEncapsulation Make only those code public which is really intended to be public Hide as much as possible from the outer world In perfect word only the (service) interfaces are public Makes application More robust against changes because third party code can only be depend on a little part of your applications‘s implementation Architecture smarter, because you need to think about it in more detail Slide 48 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  44. 44. Slide 49ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > 11.11.2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×