Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Senior Developer, R&D, Adobe Digital Mar...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
What?
Share our experience using OSGi
(A...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
What?
the
GOODthe
BADthe
UGLY
symbols by...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Trenches?
Web Content Management
and Dig...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
What we use from OSGi
Bundles (using Mav...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Famous quotesthe short version
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Famous Quotes, #2
“Each (OSGi) bundle ca...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Famous Quotes, #4
“The lifecycle model o...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Famous Quotes, #6
“OSGi makes "impossibl...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
The Good
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Modularity
Classloading
distinct from
cl...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Declarative Services
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Clean OSGi APIs
Just a few
basic example...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Dynamic load/unload
Just copy bundle jar...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Plugins for everything
Servlets
Mime-typ...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
The Bad
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Granularity?
How many bundles? Services?...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Integration testing...
V5.3
V6.54
V4.2
V...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Testing options
Unit testing In-framewor...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
I want my...
Spring
J2EE
App Server
Guic...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
The Ugly
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Asynchronicity...
V5.3
V6.54
V4.2
V5.11
...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Unpredictable assemblies
V5.3
V6.54
V4.2...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
The Summary
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
My vision back in 2009...
Developers got...
OSGi Alliance Community Event 2012
Bertrand DelacrétazOSGiTales from the trenches
Conclusions
Modularity. modularity. modu...
Upcoming SlideShare
Loading in …5
×

Tales from the OSGi Trenches - Bertrand Delacretaz

253 views

Published on

OSGi Community Event 2012

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Tales from the OSGi Trenches - Bertrand Delacretaz

  1. 1. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Senior Developer, R&D, Adobe Digital Marketing Systems Apache Software Foundation Member and (current) Director http://grep.codeconsult.ch - @bdelacretaz - bdelacretaz@apache.org OSGi Alliance Community Event, Ludwigsburg, October 2012 slides revision: 2012-10-22 Bertrand Delacrétaz OSGi Ta l e s f r o m t h e t r e n c h e s Adobe CQ5: a real-life OSGi case study
  2. 2. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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. silver
  3. 3. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches What? the GOODthe BADthe UGLY symbols by ppdigital , o0o0xmods0o0oon and clarita, on morguefile.com Just my own, personal opinion as a software developer...
  4. 4. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Trenches? Web Content Management and Digital Marketing system. Includes its own JCR content store. About 200 OSGi bundles. Install instructions fit in a tweet. Built on Apache Sling, Apache Felix and Apache Jackrabbit www.adobe.com/products/cq.html http://jackrabbit.apache.org http://felix.apache.org http://sling.apache.org BTW...wearehiring! jobs-basel@adobe.com
  5. 5. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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
  6. 6. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Famous quotesthe short version
  7. 7. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Famous Quotes, #2 “Each (OSGi) bundle can serve as a micro application, having it's own lifecycle, having it's 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
  8. 8. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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
  9. 9. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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
  10. 10. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches The Good
  11. 11. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Modularity Classloading distinct from class visibility. Public packages Metadata OSGi bundle Private packages Matchless picture: Alvimann on morguefile.com OSGi bundles as reusable components. Dynamic setup and updates that work. At last!
  12. 12. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Declarative Services
  13. 13. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Clean OSGi APIs Just a few basic examples...
  14. 14. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Dynamic load/unload Just copy bundle jar to Sling’s JCR repository (WebDAV) Bundle activated and started. (using Sling’s installer module)
  15. 15. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Plugins for everything Servlets Mime-type based handlers Content editors based on JCR node properties Content renderers and decorators Debugging/monitoring tools Mail and messaging services etc, etc... Legacy integration gateways
  16. 16. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches The Bad
  17. 17. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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?
  18. 18. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Integration testing... V5.3 V6.54 V4.2 V5.11 V1.03 V4.22 V3.22 V2.13 V3.2 V3.2 V6.4 V1.03 V3.21 V1.11 V1.05 V6.4 V5.6 V2.4 V3.4 V5.43 In-system testing? but when done!
  19. 19. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Testing options Unit testing In-framework testing Integration testing Necessary but usually not sufficient. Mocks can be painful Relatively new tools, can be slow Much slower but ok for actual integration testing JUnit, TestNG, Mocks, etc.. Pax Exam, Sling testing tools, etc. Start application and test it “from the outside”. See Apache Sling’s launchpad/testing module
  20. 20. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches I want my... Spring J2EE App Server Guice do you really need it?
  21. 21. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches The Ugly
  22. 22. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Asynchronicity... V5.3 V6.54 V4.2 V5.11 V1.03 V4.22 V3.22 V4.5 V7.4 V2.13 V3.2 V3.2 V6.4 V1.03 V3.21 V1.11 V1.05 V6.4 V5.6 V2.4 V3.4 V5.43 “unpredictable” startup order 1 19 7 11 15 14 17 10 3 16 18 9 8 4 6 2 11 5 13 12 19 20 Is the system ready now? Threading issues? Mostly from Declarative Services, not OSGi itself.
  23. 23. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Unpredictable assemblies V5.3 V6.54 V4.2 V5.11 V1.03 V4.22 V3.22 V4.5 V2.13 V3.2 V3.2 V6.4 V1.03 V3.21 V1.11 V1.05 V6.4 V5.6 V2.4 V3.4 V5.43 Spot the monsters! Discipline (and semantic versioning) help. Integration (and in-system) testing required.
  24. 24. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches The Summary
  25. 25. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches 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. √ √ √ √
  26. 26. OSGi Alliance Community Event 2012 Bertrand DelacrétazOSGiTales from the trenches Conclusions Modularity. modularity. modularity. 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) BTW...wearehiring! jobs-basel@adobe.com

×