![Page 1: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/1.jpg)
Xander Uiterlinden Sander Mak !
Luminis Technologies
@uiterlix @sander_mak
The Ultimate Dependency Manager Shootout
![Page 2: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/2.jpg)
@uiterlix @sander_mak
Who we are
Sander Mak
http://branchandbound.net
@sander_mak
http://blog.uiterlinden.nl
@uiterlix
Xander Uiterlinden
![Page 3: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/3.jpg)
@uiterlix @sander_mak
Agenda
OSGi Services Dependency Managers Comparison
Overview/community Code Performance
Conclusion
![Page 4: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/4.jpg)
OSGi Services
![Page 5: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/5.jpg)
@uiterlix @sander_mak
OSGi Services
Provider Bundle! api.MyService impl.MyServiceImpl
Consumer Bundle
new MyServiceImpl()
Strong coupling to implementation !
What if provider bundle not available/stops? !
What about configuration?
api + impl package dependency
![Page 6: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/6.jpg)
@uiterlix @sander_mak
register OSGi Service Registry
Provider Bundle! api.MyService impl.MyServiceImpl
Consumer!Bundle
lookup
only api package dependency
Decoupling through interfaces Inversion of Control Service dynamics
OSGi Services
![Page 7: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/7.jpg)
Dependency Managers
![Page 8: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/8.jpg)
@uiterlix @sander_mak
Why Dependency Managers?
![Page 9: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/9.jpg)
@uiterlix @sander_mak
Why Dependency Managers?
![Page 10: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/10.jpg)
@uiterlix @sander_mak
Why Dependency Managers?
![Page 11: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/11.jpg)
@uiterlix @sander_mak
Why Dependency Managers?
Cut down the boilerplate Decouple from OSGi APIs Dependency Injection
Testability Component models
Aspects Adapters Etc.
![Page 12: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/12.jpg)
@uiterlix @sander_mak
Why Dependency Managers?
Cut down the boilerplate Decouple from OSGi APIs Dependency Injection
Testability Component models
Aspects Adapters Etc.
Components…?!!
org.apache.felix.ipojo.annotations.Component! org.osgi.service.component.annotations.Component aQute.bnd.annotation.component.Component! org.apache.felix.dm.annotation.api.Component! org.springframework.stereotype.Component! …. !Notions: contract-based, reactive, explicit lifecycle
![Page 13: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/13.jpg)
Comparison
![Page 14: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/14.jpg)
@uiterlix @sander_mak
The lineup
Felix Dependency
Manager
Felix iPojo
Declarative Services
Blueprint
![Page 15: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/15.jpg)
@uiterlix @sander_mak
The lineup
Felix Dependency
Manager
Felix iPojo
Compendium Specifications
Declarative Services
Blueprint
![Page 16: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/16.jpg)
@uiterlix @sander_mak
The lineup
Felix Dependency
Manager
Felix iPojo
ImplementationsCompendium Specifications
Declarative Services
Blueprint
![Page 17: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/17.jpg)
@uiterlix @sander_mak
The lineup
Felix Dependency
Manager
Felix iPojo
ImplementationsCompendium Specifications
Declarative Services
!!
KnopflerFish
!!
Equinox
!!
Apache Aries
Felix Service Component
Runtime
Eclipse Gemini BlueprintBlueprint
![Page 18: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/18.jpg)
@uiterlix @sander_mak
The lineup: disclaimer
We primarily work with (and on) Felix DM
![Page 19: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/19.jpg)
@uiterlix @sander_mak
Since R4 (2005) DS 1.1 with R4.2, DS 1.2 with R5 XML based
True POJOs Or: DS annotations to generate XML
!
Declarative Services
![Page 20: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/20.jpg)
@uiterlix @sander_mak
Since R4 (2005) DS 1.1 with R4.2, DS 1.2 with R5 XML based
True POJOs Or: DS annotations to generate XML
!
Additional abstractions:ComponentContext for each component ComponentFactory: client initiates instantiation
Bundle 1
Component!Instance
Component!Description
Bundle 2
Component!Instance
Component!Description
Service
reference
provide
Declarative Services
![Page 21: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/21.jpg)
@uiterlix @sander_mak
Felix SCR
Last release
User list
License
March 2014
~50 msg
Apache 2.0
Open issues 25
Since 2007
![Page 22: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/22.jpg)
@uiterlix @sander_mak
Eclipse Gemini Blueprint
DM Server Gemini Blueprint
Spec since R4.2 (2009) Familiar for Spring devs Declarative: XML based
Annotations in Aries, but not in spec (or Gemini) Components proxied: ‘Dampens’ service dynamics
2009
![Page 23: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/23.jpg)
@uiterlix @sander_mak
Eclipse Gemini Blueprint
DM Server Gemini Blueprint
Spec since R4.2 (2009) Familiar for Spring devs Declarative: XML based
Annotations in Aries, but not in spec (or Gemini) Components proxied: ‘Dampens’ service dynamics
2009
Bundle 1
Application Context
Bundle 2
Service
reference
export
Bean
Bean
Bean
Application Context
Bean
Bean
![Page 24: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/24.jpg)
@uiterlix @sander_mak
Eclipse Gemini Blueprint
Last release
User list
License
August 2012
~60 msg
EPL
Open issues 17
Since 2009
![Page 25: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/25.jpg)
@uiterlix @sander_mak
Lots of 404s :(
Eclipse Gemini Blueprint
Last release
User list
License
August 2012
~60 msg
EPL
Open issues 17
Since 2009
![Page 26: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/26.jpg)
@uiterlix @sander_mak
Lots of 404s :(
Eclipse Gemini Blueprint
Last release
User list
License
August 2012
~60 msg
EPL
Open issues 17
Since 2009
![Page 27: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/27.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
DSL for component definition in Activator Programmatic Annotation based (bnd plugin)
Embraces service dynamics
![Page 28: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/28.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
DSL for component definition in Activator Programmatic Annotation based (bnd plugin)
Embraces service dynamics
Bundle 1
Component!Instance
Bundle 2
Component!Instance
Component!Instance
Service
reference
adapt
Service’
publish
Service
aspect
Additional abstractions:Aspect: intercept and republish service Adapter: publish service with adapted interface
![Page 29: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/29.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Last release
User list
License
Januari 2013
~1 msg
Apache 2.0
Open issues 22
Since 2004
![Page 30: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/30.jpg)
@uiterlix @sander_mak
Programmatic API, XML and annotations Proxy based Bytecode manipulation
Felix iPojo
![Page 31: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/31.jpg)
@uiterlix @sander_mak
Programmatic API, XML and annotations Proxy based Bytecode manipulation
Felix iPojo
Bundle 1 Bundle 2
Component
Component!instance
Service
provideComponent
require
Component!instance
!
!
Composites: intra-bundle mechanism Scoped service registries Pluggable handlers
Additional abstractions:
![Page 32: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/32.jpg)
@uiterlix @sander_mak
Felix iPojo
Last release
User list
License
March 2014
~130 msg
Apache 2.0
Open issues 30
Since 2008
![Page 33: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/33.jpg)
@uiterlix @sander_mak
Felix iPojo
Last release
User list
License
March 2014
~130 msg
Apache 2.0
Open issues 30
Since 2008
Best site among DMs!
![Page 34: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/34.jpg)
Comparison: code
![Page 35: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/35.jpg)
@uiterlix @sander_mak
The example
http://bit.ly/dmshootout
![Page 36: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/36.jpg)
@uiterlix @sander_mak
Extender pattern
Application bundle 1
Application bundle 2
Application bundle 3
SCR/iPojo/Blueprint/(DM!runtime) bundle
Service Registry
Some-Header: … register services
![Page 37: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/37.jpg)
@uiterlix @sander_mak
Declarative Services
META-INF/MANIFEST.MF!OSGI-INF/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
![Page 38: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/38.jpg)
@uiterlix @sander_mak
Declarative Services
META-INF/MANIFEST.MF!OSGI-INF/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
![Page 39: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/39.jpg)
@uiterlix @sander_mak
Declarative Services
META-INF/MANIFEST.MF!OSGI-INF/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
![Page 40: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/40.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 41: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/41.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 42: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/42.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 43: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/43.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 44: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/44.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 45: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/45.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 46: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/46.jpg)
@uiterlix @sander_mak
Declarative Services
Dashboard Bundle
![Page 47: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/47.jpg)
@uiterlix @sander_mak
Declarative Services
No direct field injection Defaults:
Delayed component (activate on use) Static policy -> many reactivations
!
!
!
Static Dynamic
Reluctant Do nothing Rebind optionals
Greedy Reactivate Rebind
What if ‘better’ service arrives?
![Page 48: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/48.jpg)
@uiterlix @sander_mak
META-INF/MANIFEST.MF!OSGI-INF/blueprint/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
BluePrint
![Page 49: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/49.jpg)
@uiterlix @sander_mak
META-INF/MANIFEST.MF!OSGI-INF/blueprint/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
Bundle-Blueprint header optional
BluePrint
![Page 50: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/50.jpg)
@uiterlix @sander_mak
META-INF/MANIFEST.MF!OSGI-INF/blueprint/temp.xml!!TemperatureSensor.class
Temperate Sensor Bundle
Bundle-Blueprint header optional
BluePrint
![Page 51: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/51.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 52: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/52.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 53: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/53.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 54: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/54.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 55: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/55.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 56: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/56.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 57: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/57.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 58: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/58.jpg)
@uiterlix @sander_mak
BluePrint
Dashboard Bundlesnipped 10+ lines of namespaces :(
![Page 59: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/59.jpg)
@uiterlix @sander_mak
BluePrint!
Strong focus on intra-bundle composition Hides dynamicity (until TimeOutException…)
If dependency goes away, component is not stopped. If service is exposed, unregisters it. No lazy activation like DS Whole ‘applicationContext’ started or not
(Custom) TypeConverters Constructor/setter injection, no field injection Namespace hell :(
!
![Page 60: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/60.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
META-INF/MANIFEST.MF!!Activator.class!TemperatureSensor.class
Temperate Sensor Bundle
![Page 61: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/61.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
META-INF/MANIFEST.MF!!Activator.class!TemperatureSensor.class
Temperate Sensor Bundle
![Page 62: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/62.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
META-INF/MANIFEST.MF!!Activator.class!TemperatureSensor.class
Temperate Sensor Bundle
![Page 63: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/63.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
META-INF/MANIFEST.MF!!Activator.class!TemperatureSensor.class
Temperate Sensor Bundle
![Page 64: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/64.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
META-INF/MANIFEST.MF!!Activator.class!TemperatureSensor.class
Temperate Sensor Bundle
![Page 65: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/65.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 66: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/66.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 67: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/67.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 68: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/68.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 69: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/69.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 70: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/70.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 71: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/71.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 72: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/72.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
Dashboard Bundle
![Page 73: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/73.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
It’s code: dynamically create and depend on services Annotations available (+ bnd plugin) Field injection, NullObject pattern Manual mgmt. of list of dependencies :( Services registered eagerly from Activator Features: aspects, adapters
!DM 4 coming up…
![Page 74: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/74.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
https://bitbucket.org/uiterlix/ravioli
!
![Page 75: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/75.jpg)
@uiterlix @sander_mak
Felix Dependency Manager
https://bitbucket.org/uiterlix/ravioli
!
![Page 76: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/76.jpg)
@uiterlix @sander_mak
Felix iPojo
!TemperatureSensor.class!metadata.xml!!META-INF/MANIFEST.MF!
Temperate Sensor Bundle
Generated by IDE plugin by processing annotations and metadata.xml
![Page 77: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/77.jpg)
@uiterlix @sander_mak
Felix iPojo
!TemperatureSensor.class!metadata.xml!!META-INF/MANIFEST.MF!
Temperate Sensor Bundle
Generated by IDE plugin by processing annotations and metadata.xml
![Page 78: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/78.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 79: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/79.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 80: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/80.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 81: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/81.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 82: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/82.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 83: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/83.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 84: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/84.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 85: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/85.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 86: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/86.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 87: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/87.jpg)
@uiterlix @sander_mak
Felix iPojo
![Page 88: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/88.jpg)
@uiterlix @sander_mak
Felix iPojoBoth ‚static’ configuration and configuration using code Dependency manager with the most advanced features:
External handlers Service binding interceptors Stereotypes
Annotations limited to declaring components and ‚simple’ instances. XML recommended for declaring instances. Shell commands for component inspection
!
![Page 89: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/89.jpg)
Comparison: performance
![Page 90: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/90.jpg)
@uiterlix @sander_mak
BenchmarksDon’t be afraid of too many services ? Promises…
!
„Each bundle may register zero or more
services. Each bundle may also use zero or
more services. There exists no limit on the
number of services, more than the ones given
by memory limits or java security permissions.” (Knoplerfish tutorial)
![Page 91: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/91.jpg)
@uiterlix @sander_mak
Benchmark scenario!
!
Temperature sensors for each postal code in the Nederlands 463860 Sensor services !
Service properties: - Province - Municipality - City - PostalCode
![Page 92: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/92.jpg)
@uiterlix @sander_mak
Benchmarks
Publishing Sensor services Felix, Equinox, Knoplerfish Plain OSGi, DM, iPojo
!
Consuming Sensor services Whiteboard; all sensors in Amsterdam(&(province=Noord-Holland)(municipality=Amsterdam)) Felix, Equinox, Knoplerfish DS, DM, iPojo, Blueprint
![Page 93: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/93.jpg)
@uiterlix @sander_mak
Disclaimer
Results are as-is, no further investigation done No optimizations done
!
You can repeat these tests yourself. Projects are available on github
http://bit.ly/dmshootout
![Page 94: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/94.jpg)
@uiterlix @sander_mak
Register services (Equinox)
ipojo
DMOSGi
Dur
atio
n in
ms.
0
175000
350000
525000
700000
10000 30000 50000 70000 90000 110000 130000 150000 170000 190000 210000 230000 250000 270000 290000 310000 330000 350000 370000 390000 410000 430000 450000
OSGi DM iPojo
![Page 95: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/95.jpg)
@uiterlix @sander_mak
0
50000
100000
150000
200000
250000
10000 30000 50000 70000 90000 110000 130000 150000 170000 190000 210000 230000 250000 270000 290000 310000 330000 350000 370000 390000 410000 430000 450000
OSGi DM iPojo
Register services (Felix)
iPojo
DMOSGi
![Page 96: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/96.jpg)
@uiterlix @sander_mak
0
50000
100000
150000
200000
250000
10000 30000 50000 70000 90000 110000 130000 150000 170000 190000 210000 230000 250000 270000 290000 310000 330000 350000 370000 390000 410000 430000 450000
OSGi DM iPojo
Register services (Knoplerfish)
iPojo
DMOSGi
![Page 97: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/97.jpg)
@uiterlix @sander_mak
0
100000
200000
300000
400000
500000
600000
700000
10000 30000 50000 70000 90000 110000 130000 150000 170000 190000 210000 230000 250000 270000 290000 310000 330000 350000 370000 390000 410000 430000 450000
OSGi equinox DM equinox iPojo equinox OSGi felix DM felix iPojo felixOSGi knoplerfish DM knoplerfish iPojo knoplerfish
Register services (combined)
iPojo Equinox
OSGi & DM Felix
iPojo Felix & Knoplerfish
OSGi & DM Equinox & Knoplerfish
![Page 98: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/98.jpg)
@uiterlix @sander_mak
Register services
Observations Non linear results for registering services with Felix Registering services using iPojo takes considerably longer compared to plain OSGi and DM
![Page 99: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/99.jpg)
@uiterlix @sander_mak
Tim
e in
milli
s
0
400
800
1200
1600
blueprint dm ds ipojo
Consuming servicesInjecting 19021 services into a single consumer on Equinox
![Page 100: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/100.jpg)
@uiterlix @sander_mak
Tim
e in
milli
s
0
400
800
1200
1600
blueprint dm ds ipojo
injection injection and method invocation
Method invocation overheadInjecting 19021 services into a single consumer on Equinox,
and invoking a method on the injected services
![Page 101: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/101.jpg)
@uiterlix @sander_mak
iPojo and # of servicesTi
me
in m
illis
0
15000
30000
45000
60000
# services in service registry50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 1050 1100 1150 1200 1250 1300 1350 1400 1450 1500 1550 1600
iPojoInjecting a single service into a single consumer on Equinox
![Page 102: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/102.jpg)
@uiterlix @sander_mak
Performance considerationsUse of LDAP filters
Filter complexity, service registry scans Felix DM provides optimization though indexing service properties !
!
Bundle starting order Service tracker obtain initial versus service listener events
0
75000
150000
225000
300000
197 2878
Default With index
![Page 103: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/103.jpg)
Conclusion
![Page 104: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/104.jpg)
@uiterlix @sander_mak
Conclusion
Features ranging from simple to advanced (DS, Blueprint < DM < iPojo) Annotation/XML-only frameworks are easy to use but provide less dynamics Consider the expected size of your application (services, dependencies) and run some test before choosing one! You can mix & match
… but don’t do that
![Page 105: The Ultimate Dependency Manager Shootout (QCon NY 2014)](https://reader035.vdocuments.net/reader035/viewer/2022081400/5550f554b4c90501448b46db/html5/thumbnails/105.jpg)
@uiterlix @sander_mak
Questions?http://bit.ly/dmshootoutCode:
Sander Mak
http://branchandbound.net
@sander_mak
http://blog.uiterlinden.nl
@uiterlix
Xander Uiterlinden