SlideShare a Scribd company logo
OSGi Best and Worst Practices Chris Aniszczyk — Red Hat Jeff McAffer — EclipseSource Martin Lippert — it-agile Paul VanderLei — Band XI
Don’t Program OSGi
 
Sometimes it better not to know Ignorance is bliss
It's bad mojo to pollute the POJO
Your code sucks. Versioning can help.
Good fences make good neighbors
Size Does Matter
Manage your dependencies
Use services
 
 
Not everything should be a service
...and OSGi made all the apps dynamic
The Easter Bunny is dead
 
If you don't test it, it doesn't work!
OSGi is not a religion
 
Lets look at some controversy Now some controversy
Require-Bundle  Import-Package
Services or Extensions?
Got Questions? http://equinoxosgi.org

More Related Content

PDF
Alice the bot @rootconf
PPT
Android Developer Skills, Techniques, and Patterns
PDF
Modern Agile - Joshua Kerievsky
PDF
OSGi Best Practices – Learn how to prevent common mistakes and build robust, ...
PDF
Bringing an open source project to the Linux Foundation
PDF
Starting an Open Source Program Office (OSPO)
PDF
Open Container Initiative Update
PDF
Cloud Native Landscape (CNCF and OCI)
Alice the bot @rootconf
Android Developer Skills, Techniques, and Patterns
Modern Agile - Joshua Kerievsky
OSGi Best Practices – Learn how to prevent common mistakes and build robust, ...
Bringing an open source project to the Linux Foundation
Starting an Open Source Program Office (OSPO)
Open Container Initiative Update
Cloud Native Landscape (CNCF and OCI)

More from Chris Aniszczyk (20)

PDF
Rise of Open Source Programs
PDF
The Open Container Initiative (OCI) at 12 months
PDF
Open Source Lessons from the TODO Group
PDF
Getting Students Involved in Open Source
PDF
Life at Twitter + Career Advice for Students
PDF
Creating an Open Source Office: Lessons from Twitter
PDF
The Open Source... Behind the Tweets
PDF
Apache Mesos at Twitter (Texas LinuxFest 2014)
PDF
Evolution of The Twitter Stack
PDF
Open Source Craft at Twitter
KEY
Open Source Compliance at Twitter
PDF
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
PPT
Effective Git with Eclipse
ODP
Evolution of Version Control In Open Source
ODP
ESE 2010: Using Git in Eclipse
KEY
SWTBot Tutorial
KEY
Helios in Action: Git at Eclipse
PDF
Eclipse e4
KEY
Introduction to EclipseRT (JAX 2010)
KEY
EclipseRT, Equinox and OSGi
Rise of Open Source Programs
The Open Container Initiative (OCI) at 12 months
Open Source Lessons from the TODO Group
Getting Students Involved in Open Source
Life at Twitter + Career Advice for Students
Creating an Open Source Office: Lessons from Twitter
The Open Source... Behind the Tweets
Apache Mesos at Twitter (Texas LinuxFest 2014)
Evolution of The Twitter Stack
Open Source Craft at Twitter
Open Source Compliance at Twitter
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Effective Git with Eclipse
Evolution of Version Control In Open Source
ESE 2010: Using Git in Eclipse
SWTBot Tutorial
Helios in Action: Git at Eclipse
Eclipse e4
Introduction to EclipseRT (JAX 2010)
EclipseRT, Equinox and OSGi
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
A Presentation on Artificial Intelligence
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
A Presentation on Artificial Intelligence
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MYSQL Presentation for SQL database connectivity
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Ad

OSGi Best and Worst Practices

Editor's Notes

  • #3: Jeff
  • #4: Jeff Don’t be too surprised OSGi is rather elegant It is minimalist and unpresumptious This is awesome as it keeps system size down But it is a system's level programming model. - APIs are low level - Dynamics are hard, cause, well, dynamic stuff is hard and there is not a lot of help Fundamentally, OSGi is an implementation detail, an enabling element.  For most people is it something to be hidden from view
  • #5: Sometimes its better not to know whats around you Programming POJOs help isolate you from the OSGi gorp Really we are talking about dependency injection and a style of coding. - Encourages reuse - eases testing - Clarifies design and dependencies This is a pervasive theme throughout this talk In short: Its bad mojo to pollute the POJO
  • #7: Chris
  • #8: chris
  • #9: Martin
  • #10: Jeff Imagine this Hello <cable co> my TV is not working string another line Keep doing that until the price of copper skyrockets and someone steals the pole Know the bundle food chain Minimizing your dependencies improves reuse Improves freedom of action
  • #11: Paul Using services as the unit of reuse is preferred over just sharing packages: -lifecycle management -pluggability DS is better than Service Tracker: -for a bundle needing two services..... -100 lines of code vs 8 lines of XML -error-prone -required hours of effort from experts DS: -encourages good componentizaiton -allows lazy classloading -nice tooling ServiceTracker: -too easily ties your code to OSGi -makes testing and reuse more difficult -pollutes the POJO (bad mojo)
  • #12: this is for a bundle requiring two services
  • #14: Paul just because something in your application needs to be registered, it does not mean that  you should make that thing a service and use the service registry -whiteboard pattern can easily fall into this trap -example: student registers for a course. student is NOT a service -core & other utility classes -HashMapFactoryService counter-example
  • #15: Jeff OSGi is a bit of a fairy tale story. The small but secretly powerful modularity system That runs around brings dynamism to everyone Yeah, well, sorry, but fairy tales are just that, fairy tales. <any kids in the room?>
  • #16: Oh, and BTW, …
  • #17: Dynamics are not free Real work is needed Analogous to running multi-threaded – you have to code for it. not for everyone Relate to Eclipse adoption
  • #18: Paul
  • #19: Paul OSGi is not omnipresent -If you’re spending all your time writing OSGi-related code, you’re doing it wrong! OSGi is not infallible -Plenty of crap in the OSGi holy scriptures: Wire Admin, Event Admin… -OSGi is not omnipotent Not everything OSGi provides is ideal for your application ConfigAdmin
  • #21: Martin
  • #22: Martin
  • #23: Martin
  • #24: shameless plug