SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Very Important Bundles



         Roman Roelofsen
          Lead Architect

               @

                 
OSGi Bundles

    ●   Even though this depends on the architecture
        and dependencies, OSGi has proven that
        bundles increase the assembly possibilites
        –   Rich meta-data, enforced resolving, ...
    ●   E.g. copy & paste files to enhance the runtime
        features („VB-feeling“ on module level)
        –   Console (test, debug, ...)
    ●   Bundles can improve the development process
        –   Some bundles make it easy, some hard...
                                  
Good Bundles




        #6

      Logging

          
Good Bundles: Logging

●       Problem
        –   Your application + frameworks use different
            logging APIs, e.g. log4j, commons logging, ...
●       Solution
        –   PAX Logging
        –   2 bundles: pax-logging-api & pax-logging-service
        –   8 logging APIs
        –   Redirects to LogService & log4j
     
        –   Configuration Admin support
                                  
Good Bundles




          #5

    Web Development

            
Good Bundles: Web Development


●       Problem
        –   HttpService is simply not enough
●       Solution
        –   PAX Web
        –   Whiteboard pattern (service registry)
        –   Extender pattern (web.xml)
        –   Support for filters and JSP
        –   Configuration Admin support
                                   
Good Bundles




        #4

     Remoting

          
Good Bundles: Remoting
●       Problem
        –   You want to expose some of your services as
            endpoints
        –   You want to access endpoints via services
●       Solution
        –   Apache CXF Distributed OSGi
        –   Single bundle distribution!
        –   Export endpoint
             ●service.exported.interfaces = *
        –   Import Endpoint
                                     
             ●   /OSGI-INF/remote-service/remote-services.xml
Good Bundles




             #3

    Dependency Injection /
     Service Interaction

               
Good Bundles: DI
●       Problem
        –   You want dependency injection
●       Solution
        –   Declarative Services
             ●No full DI support, mostly for dealing with services
        –   Peaberry
             ●Google Guice add-on, Java based DSL
        –   Apache Felix iPOJO
             ●Sophisticated, a bit challenging
        –   Spring Dynamic Modules
                                     
             ●   Spring add-on
Good Bundles




          #2

    Framework Tooling

             
Good Bundles: Framework Tooling

●       Problem
        –   The console is nice, but sometimes a bit annoying
        –   Install file: /home/user/dev/workspace/app/.../bundle.jar
        –   Track EventAdmin events

●       Solution
        –   Apache Felix Web Console
        –   Basic setup requires only one bundle
        –   Works with Felix/Equinox/...
                                      
Good Bundles: Framework Tooling




                
Good Bundles




         #1

    Bundle Tooling

           
Good Bundles: Bundle Tooling


●       Problem
        –   Create bundles for quick tests
        –   Manifest reading
        –   Library wrapping
        –   ...
●       Solution
        –   Peter Kriens' BND

                                     
Good Bundles: Bundle Tooling




                  
Good Bundles: Bundle Tooling




                  
Better Modularity with Bundles




                  ≠



                   
Dependencies


●       Writing bundles does not automatically imply that
        dependency problems are avoided
●       Require-Bundle is just as bad as „new Service()“
        –   Only on a different level
        –   Rely on Import-Package, let the resolver do the rest
        –   Be open for future modifications
●       Provide whiteboard / extender pattern implementation
        where reasonable
                                         
Bundle Granularity

    ●   Common practive, e.g. Maven
        –   Divide you build into several modules
        –   Each module will result in a JAR

    ●   Maven-bundle-plugin
        –   Add OSGi metadata

    ●   Ship bundles
        –   User happy?
                                  
Bundle Granularity


Build            Bundle               User's POV

core1.jar        core1.jar            mandatory
core2.jar        core2.jar

protocolA1.jar   protocolA1.jar
protocolA2.jar   protocolA2.jar       either this
protocolA3.jar   protocolA3.jar

protocolB1.jar   protocolB1.jar
protocolB2.jar   protocolB2.jar       or this
                                   
Bundle Granularity


Build            Bundle              User's POV

core1.jar        core.jar            mandatory
core2.jar

protocolA1.jar
protocolA2.jar   protocolA.jar       either this
protocolA3.jar

protocolB1.jar
protocolB2.jar   protocolB.jar       or this
                                  
Summary

    ●   Bundles are so much better than plain JARs
    ●   Bundles are deliveries for your users
    ●   Granularity during development is different from
        granularity for deployments
    ●   Embed your dependencies if they do not provide
        a value for your user
        –   Bundle-Classpath is your friend
    ●   Avoid Require-Bundle & DynamicImport-
        Package
                                 
THANK YOU!


                    Roman Roelofsen
         
            r.roelofsen@prosyst.com
●   http://www.flickr.com/photos/jessicafm/2767435428


●http://www.manuelm.org/blog/wp-
content/uploads/2009/02/overview.png




                                 

Contenu connexe

Tendances

NetBeans Plugin Development Workshop
NetBeans Plugin Development WorkshopNetBeans Plugin Development Workshop
NetBeans Plugin Development Workshop
elliando dias
 

Tendances (20)

OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
 
미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기미들웨어 엔지니어의 클라우드 탐방기
미들웨어 엔지니어의 클라우드 탐방기
 
AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...
AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...
AD113 -- IBM Lotus Notes Discussion Template: Next Generation and Other OpenN...
 
Extending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your wayExtending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your way
 
Ad110 - Unleash the Power of Xpages
Ad110 - Unleash the Power of XpagesAd110 - Unleash the Power of Xpages
Ad110 - Unleash the Power of Xpages
 
Magento caching
Magento cachingMagento caching
Magento caching
 
Jvm mbeans jmxtran
Jvm mbeans jmxtranJvm mbeans jmxtran
Jvm mbeans jmxtran
 
Developing in MODx
Developing in MODxDeveloping in MODx
Developing in MODx
 
What's wrong with web
What's wrong with webWhat's wrong with web
What's wrong with web
 
NetBeans Plugin Development Workshop
NetBeans Plugin Development WorkshopNetBeans Plugin Development Workshop
NetBeans Plugin Development Workshop
 
PHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHPPHPCR - Standard Content Repository for PHP
PHPCR - Standard Content Repository for PHP
 
Microservices, because everyone wants to be cool
Microservices, because everyone wants to be coolMicroservices, because everyone wants to be cool
Microservices, because everyone wants to be cool
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
 
00_VB_Intro
00_VB_Intro00_VB_Intro
00_VB_Intro
 
JBoss Community Introduction
JBoss Community IntroductionJBoss Community Introduction
JBoss Community Introduction
 
Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
 
Arquillian 소개
Arquillian 소개Arquillian 소개
Arquillian 소개
 
Super performing websites with TYPO3 and Varnish
Super performing websites with TYPO3 and VarnishSuper performing websites with TYPO3 and Varnish
Super performing websites with TYPO3 and Varnish
 

En vedette

תקדים צארלס קוריאה
תקדים צארלס קוריאהתקדים צארלס קוריאה
תקדים צארלס קוריאה
Ilan Langer
 
Quranic supplication (Duas) from The Only God (Allah)
Quranic supplication (Duas) from The Only God (Allah)Quranic supplication (Duas) from The Only God (Allah)
Quranic supplication (Duas) from The Only God (Allah)
Fawad Kiyani
 
Dualcover
DualcoverDualcover
Dualcover
kareem
 
Iir Jurisprudentiedag
Iir JurisprudentiedagIir Jurisprudentiedag
Iir Jurisprudentiedag
weerokoster
 
GelişImsel Psikopatoloji Klinikte 2.BöLüM
GelişImsel Psikopatoloji Klinikte 2.BöLüMGelişImsel Psikopatoloji Klinikte 2.BöLüM
GelişImsel Psikopatoloji Klinikte 2.BöLüM
Guzel Gunler Poliklinigi
 

En vedette (20)

Webanwendungen mit Apache HBase entwickeln
Webanwendungen mit Apache HBase entwickelnWebanwendungen mit Apache HBase entwickeln
Webanwendungen mit Apache HBase entwickeln
 
Про розвиток сімейних форм виховання: кількісні та якісні показники
Про розвиток сімейних форм виховання: кількісні та якісні показникиПро розвиток сімейних форм виховання: кількісні та якісні показники
Про розвиток сімейних форм виховання: кількісні та якісні показники
 
New Media Session for NLB Staff June25 09
New Media Session for NLB Staff  June25 09New Media Session for NLB Staff  June25 09
New Media Session for NLB Staff June25 09
 
To Christians with Love
To Christians with LoveTo Christians with Love
To Christians with Love
 
Презентация Гая Ханова
Презентация Гая ХановаПрезентация Гая Ханова
Презентация Гая Ханова
 
HMF Emarketing Workshop
HMF Emarketing WorkshopHMF Emarketing Workshop
HMF Emarketing Workshop
 
תקדים צארלס קוריאה
תקדים צארלס קוריאהתקדים צארלס קוריאה
תקדים צארלס קוריאה
 
Orhidee
OrhideeOrhidee
Orhidee
 
INTRODUCCIÓN:
INTRODUCCIÓN:INTRODUCCIÓN:
INTRODUCCIÓN:
 
Mn1 sec 2 - les 3 - (suratun-noor 35-40)
Mn1   sec 2 - les 3 - (suratun-noor 35-40)Mn1   sec 2 - les 3 - (suratun-noor 35-40)
Mn1 sec 2 - les 3 - (suratun-noor 35-40)
 
Quranic supplication (Duas) from The Only God (Allah)
Quranic supplication (Duas) from The Only God (Allah)Quranic supplication (Duas) from The Only God (Allah)
Quranic supplication (Duas) from The Only God (Allah)
 
Dualcover
DualcoverDualcover
Dualcover
 
South Asian Studies08
South Asian Studies08South Asian Studies08
South Asian Studies08
 
Odev zamani 28.04.12
Odev zamani 28.04.12Odev zamani 28.04.12
Odev zamani 28.04.12
 
Using Social Media for Student Gradutates
Using Social Media for Student GradutatesUsing Social Media for Student Gradutates
Using Social Media for Student Gradutates
 
Iir Jurisprudentiedag
Iir JurisprudentiedagIir Jurisprudentiedag
Iir Jurisprudentiedag
 
Crowdfunding for Social Enterprises
Crowdfunding for Social EnterprisesCrowdfunding for Social Enterprises
Crowdfunding for Social Enterprises
 
מצגת פרויקט
מצגת פרויקטמצגת פרויקט
מצגת פרויקט
 
Nu Exista Femei Urate Ci Femei Fara Bani
Nu Exista Femei Urate Ci Femei Fara BaniNu Exista Femei Urate Ci Femei Fara Bani
Nu Exista Femei Urate Ci Femei Fara Bani
 
GelişImsel Psikopatoloji Klinikte 2.BöLüM
GelişImsel Psikopatoloji Klinikte 2.BöLüMGelişImsel Psikopatoloji Klinikte 2.BöLüM
GelişImsel Psikopatoloji Klinikte 2.BöLüM
 

Similaire à VIB - Very Important Bundles

Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBay
Tony Ng
 
Calling all modularity solutions
Calling all modularity solutionsCalling all modularity solutions
Calling all modularity solutions
Sangjin Lee
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
vespian_256
 

Similaire à VIB - Very Important Bundles (20)

Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBay
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Calling all modularity solutions
Calling all modularity solutionsCalling all modularity solutions
Calling all modularity solutions
 
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
 
Modularity problems
Modularity  problemsModularity  problems
Modularity problems
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
A Real ADF Experience Part II
A Real ADF Experience Part IIA Real ADF Experience Part II
A Real ADF Experience Part II
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
 
Carbon and OSGi Deep Dive
Carbon and OSGi Deep DiveCarbon and OSGi Deep Dive
Carbon and OSGi Deep Dive
 
Production optimization with React and Webpack
Production optimization with React and WebpackProduction optimization with React and Webpack
Production optimization with React and Webpack
 
Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

VIB - Very Important Bundles

  • 1. Very Important Bundles Roman Roelofsen Lead Architect @    
  • 2. OSGi Bundles ● Even though this depends on the architecture and dependencies, OSGi has proven that bundles increase the assembly possibilites – Rich meta-data, enforced resolving, ... ● E.g. copy & paste files to enhance the runtime features („VB-feeling“ on module level) – Console (test, debug, ...) ● Bundles can improve the development process – Some bundles make it easy, some hard...    
  • 3. Good Bundles #6 Logging    
  • 4. Good Bundles: Logging ● Problem – Your application + frameworks use different logging APIs, e.g. log4j, commons logging, ... ● Solution – PAX Logging – 2 bundles: pax-logging-api & pax-logging-service – 8 logging APIs – Redirects to LogService & log4j   – Configuration Admin support  
  • 5. Good Bundles #5 Web Development    
  • 6. Good Bundles: Web Development ● Problem – HttpService is simply not enough ● Solution – PAX Web – Whiteboard pattern (service registry) – Extender pattern (web.xml) – Support for filters and JSP – Configuration Admin support    
  • 7. Good Bundles #4 Remoting    
  • 8. Good Bundles: Remoting ● Problem – You want to expose some of your services as endpoints – You want to access endpoints via services ● Solution – Apache CXF Distributed OSGi – Single bundle distribution! – Export endpoint ●service.exported.interfaces = * – Import Endpoint     ● /OSGI-INF/remote-service/remote-services.xml
  • 9. Good Bundles #3 Dependency Injection / Service Interaction    
  • 10. Good Bundles: DI ● Problem – You want dependency injection ● Solution – Declarative Services ●No full DI support, mostly for dealing with services – Peaberry ●Google Guice add-on, Java based DSL – Apache Felix iPOJO ●Sophisticated, a bit challenging – Spring Dynamic Modules     ● Spring add-on
  • 11. Good Bundles #2 Framework Tooling    
  • 12. Good Bundles: Framework Tooling ● Problem – The console is nice, but sometimes a bit annoying – Install file: /home/user/dev/workspace/app/.../bundle.jar – Track EventAdmin events ● Solution – Apache Felix Web Console – Basic setup requires only one bundle – Works with Felix/Equinox/...    
  • 13. Good Bundles: Framework Tooling    
  • 14. Good Bundles #1 Bundle Tooling    
  • 15. Good Bundles: Bundle Tooling ● Problem – Create bundles for quick tests – Manifest reading – Library wrapping – ... ● Solution – Peter Kriens' BND    
  • 16. Good Bundles: Bundle Tooling    
  • 17. Good Bundles: Bundle Tooling    
  • 18. Better Modularity with Bundles ≠    
  • 19. Dependencies ● Writing bundles does not automatically imply that dependency problems are avoided ● Require-Bundle is just as bad as „new Service()“ – Only on a different level – Rely on Import-Package, let the resolver do the rest – Be open for future modifications ● Provide whiteboard / extender pattern implementation where reasonable    
  • 20. Bundle Granularity ● Common practive, e.g. Maven – Divide you build into several modules – Each module will result in a JAR ● Maven-bundle-plugin – Add OSGi metadata ● Ship bundles – User happy?    
  • 21. Bundle Granularity Build Bundle User's POV core1.jar core1.jar mandatory core2.jar core2.jar protocolA1.jar protocolA1.jar protocolA2.jar protocolA2.jar either this protocolA3.jar protocolA3.jar protocolB1.jar protocolB1.jar protocolB2.jar protocolB2.jar or this    
  • 22. Bundle Granularity Build Bundle User's POV core1.jar core.jar mandatory core2.jar protocolA1.jar protocolA2.jar protocolA.jar either this protocolA3.jar protocolB1.jar protocolB2.jar protocolB.jar or this    
  • 23. Summary ● Bundles are so much better than plain JARs ● Bundles are deliveries for your users ● Granularity during development is different from granularity for deployments ● Embed your dependencies if they do not provide a value for your user – Bundle-Classpath is your friend ● Avoid Require-Bundle & DynamicImport- Package    
  • 24. THANK YOU! Roman Roelofsen     r.roelofsen@prosyst.com
  • 25. http://www.flickr.com/photos/jessicafm/2767435428 ●http://www.manuelm.org/blog/wp- content/uploads/2009/02/overview.png