Tales from the OSGi trenches (2012 short form edition)

2,101 views

Published on

My "Tales from the OSGi trenches" presentation at the OSGi community event 2012, Ludwigsburg, http://www.osgi.org/CommunityEvent2012/Speakers#anchor14

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,101
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
46
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Tales from the OSGi trenches (2012 short form edition)

  1. 1. Ta l e s f r o m t h e OSGi t r e n c h e s Adobe CQ5: a real-life OSGi case studyBertrand DelacrétazSenior Developer, R&D, Adobe Digital Marketing SystemsApache Software Foundation Member and (current) Directorhttp://grep.codeconsult.ch - @bdelacretaz - bdelacretaz@apache.orgOSGi Alliance Community Event, Ludwigsburg, October 2012slides revision: 2012-10-22 OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  2. 2. What? Share our experience using OSGi (Apache Felix) as the foundation of Adobe CQ5. More than five years working with OSGi, very high impact on developers, customers, service people, mostly in a positive way. OSGi is no silver bullet either. silve r OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  3. 3. What? the GOOD the BAD Just my own, the personal UGLY opinion as a software developer...symbols by ppdigital , o0o0xmods0o0oon and clarita, on morguefile.comTales from the OSGitrenches OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  4. 4. job BTW s-b ...w Trenches? ase e a l@a re h do irin Web Content Management be g! and Digital Marketing system. .co Includes its own JCR content store. m About 200 OSGi bundles. Install instructions fit in a tweet. www.adobe.com/products/cq.html Built on Apache Sling, Apache http://jackrabbit.apache.org Felix and Apache Jackrabbit http://felix.apache.org http://sling.apache.org OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  5. 5. What we use from OSGi Bundles (using Maven plugins) Lifecycle, Service Tracker Configurations and Felix Web Console Declarative Services (using Maven plugins) Sling’s installer module (like fileinstall, using JCR) Log, HTTP, Event services, JMX OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  6. 6. Famous quotes the short version OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  7. 7. Famous Quotes, #2 “Each (OSGi) bundle can serve as a micro application, having its own lifecycle, having its own citizens and each bundle can carefully decide which objects to expose to the outside world” Peter Rietzler http://peterrietzler.blogspot.com/2008/12/is-osgi-going- to-become-next-ejb-bubble.html OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  8. 8. Famous Quotes, #4 “The lifecycle model of OSGi makes life complicated. Actually, tracking services and managing all the aspects of what to do when services come and go is nasty” Peter Rietzler http://peterrietzler.blogspot.com/2008/12/is-osgi-going- to-become-next-ejb-bubble.html OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  9. 9. Famous Quotes, #6 “OSGi makes "impossible" things easy: hot deploy/upgrade, service discovery, ... and trivial things hard: hibernate, tag libraries, even deploying a simple war!” But, for the first time in my career, I see software reusability that works: service reusability. Filippo Diotalevi OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  10. 10. The Good OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  11. 11. Modularity OSGi bundle Classloading distinct from Public packages class visibility. Metadata Private packages OSGi bundles as reusable components. Dynamic setup and updates that work. At last! Matchless picture: Alvimann on morguefile.com OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  12. 12. Declarative Services OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  13. 13. Clean OSGi APIs Just a few basic examples... OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  14. 14. Dynamic load/unload Just copy bundle jar to Sling’s JCR repository (WebDAV) Bundle activated and started. (using Sling’s installer module) OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  15. 15. Plugins for everything Content editors based on Servlets JCR node properties Mime-type based handlers Debugging/monitoring tools Content renderers and decorators Legacy integration gateways Mail and messaging services etc, etc... OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  16. 16. The Bad OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  17. 17. Granularity? How many bundles? Services? CQ5: about 200 bundles, 1000 services How to handle “implementation details” libraries. Extra bundles or private packages? Strict version management required. Are we there yet? OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  18. 18. Integration testing... V4.22 V1.03 V3.21 V3.22 V4.2 V5.11 V5.3 V2.13 V6.54 V1.05 In-system V1.03 V1.11 V6.4 testing? V3.4 V3.2 V6.4 V3.2 V5.43 V2.4 V5.6 but when done!Tales from theOSGitrenches OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  19. 19. Testing options Unit testing In-framework Integration testing testing JUnit, Pax Exam, TestNG, Sling testing tools, Start application Mocks, etc. and test it “from etc.. the outside”. See Apache Sling’s launchpad/testing module Necessary Relatively new but usually tools, can Much slower not sufficient. be slow but ok for actual Mocks can integration testing be painful OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  20. 20. I want my...Spring Guice App ServerJ2EE do you really need it? OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  21. 21. The Ugly OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  22. 22. Asynchronicity... 7 14 V3.2111 17 V4.22 V4.5 V7.4 1V1.03 15 V3.22 11 V4.2 3 V5.11 19 V5.3 2 V2.13 10 V6.54 5 Threading 16 V1.05 “unpredictable” 6 V1.11 V6.4 18 V1.03 13 issues? startup order V3.4 8 V6.4 12 V3.2 4 19 V3.2 9 V5.43 V2.4 Is the system ready now? 20 V5.6 Mostly from Declarative Services, not OSGi itself.Tales from the OSGitrenches OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  23. 23. Unpredictable assemblies V4.22 V4.5 V1.03 V3.21 V3.22 V4.2 V5.11 V5.3 V2.13 V6.54 V1.05 V1.11 V6.4 V1.03 V3.4 V6.4 V3.2 V3.2 V5.43 V2.4 Spot the monsters! Discipline (and semantic versioning) help. V5.6 Integration (and in-system) testing required.Tales from theOSGitrenches OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  24. 24. The Summary OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  25. 25. My vision back in 2009... √Developers got used to it (and read the book). √Frameworks and tools improved. Distributed OSGi? Maybe. √Customers understand OSGi and like it.. √Apache Sling paved the way. OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz
  26. 26. job BTW s-b ...w Conclusions ase e a l@a re h do irin be g! .co Modularity. modularity. modularity. m OSGi fosters better structured code Dynamic services and plugins FTW! Tooling ... getting better all the time OSGi is often unfamiliar / unusual Asynchronous behavior can be problematic (declarative services) OSGitrenchesTales from the OSGi Alliance Community Event 2012 Bertrand Delacrétaz

×