SlideShare a Scribd company logo
1 of 29
Download to read offline
Structuring Software Systems with
OSGi
Ulf Fildebrandt

SAP AG

22.09.2011




                                                           OSGi Alliance Marketing © 2008-2010 . 1
                                                                                           Page
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved
                                                           All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 2   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 3   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Principles of Modularity

• Decoupling
   •    Logic has to be decoupled, otherwise the structure evolves into a monolithic
        block („architecture erosion“)

• Simplicity
   •    Design the concepts as simple as possible, otherwise the system solves non-
        existing requirements

• Extensibility
   •    Decoupling implies that frameworks are open for logic
   •    Extensibility for logic is not the exception, but rather the common principle for
        all frameworks




   Page 4    OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
OSGi basics

• Bundles are the atomic entities for structuring
  (containing binaries)
• Services are the communication means between
  bundles
• Exported packages are the public interface of bundles
• Imported packages define the usages of bundles




   Page 5   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Example




• Web application to analyze data
• OSGi bundles, services, and exported
  packages are used to structure the application


   Page 6   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Structure of Application

• Fulfills the business requirements, but no modularity
  (decoupling, extensibility)


                                                          Servlet



                 Data                                                     Data
               Source 1                                                 Source 2

   Page 7   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Structure Of Application
                                                                    Servlet



                                                           Data Aggregate


                                                                                 Data               Data
                                                                              Aggregator 1       Aggregator 2
Data Source 1                   Data Source 2



                                                                                      Data Aggregator
                                                                                         Interface


      Page 8                                                  Data Source
                OSGi Alliance Marketing © 2008-2011 . All Rights Reserved

                                                               Interface
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 9   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Interface Usage

• Implementation should only use interfaces  Services
  in OSGi
• Services are difficult to implement in OSGi fulfilling all
  lifecycle requirements (Service Tracker, Service
  Listener)  „boilerplate coding“
• Frameworks: Declarative Services (DS) is part of the
  OSGi specification, Blueprint, etc.
   •    DS are meant to declare the dependencies of services and service usage
   •    DS is a mechanism to bring dependency injection into OSGi




   Page 10   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Structure Of Application
                                                                    Servlet


                         IDataAggregate
                                                           Data Aggregate


                                                                                 Data               Data
                                                                              Aggregator 1       Aggregator 2
Data Source 1                   Data Source 2


                                                                                                 IDataAggregator
                                                                                      Data Aggregator
                                                                                         Interface
                IDataSourceService
                      IDataSource
      Page 11                                                 Data Source
                OSGi Alliance Marketing © 2008-2011 . All Rights Reserved

                         IDataItem                             Interface
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 12   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Layers

• In architecture, layers are used to structure the software
• Entities within a layer can only have dependencies to
  lower layers
• Bundles in OSGi belong to one layer only
• In reality more coarse grained frameworks are used
   •    Feature (P2, Eclipse)
   •    Application (Aries)
   •    OSGi sub system specification

• For simplicity in these examples only bundles are used


   Page 13   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Servlet                                               UI



                                                          Data Aggregate                                        Aggregate




Aggregator                                                                           Data                 Data
                                                                                  Aggregator 1         Aggregator 2



   Data Source 1                       Data Source 2                                                         Data Provider



                                                                                           Data Aggregator
Data Aggregator Interface
                                                                                              Interface



Data Source InterfaceAlliance Marketing © 2008-2011 . All Rights ReservedSource
          Page 14 OSGi                                        Data
                                                                  Interface
Class
Structure
• Classes fit
  to bundle
  structure




   Page 15   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 16   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Interface of a Layer

• Layers should have a clear interface
• API (Application Programming Interface)
   •    is defining the publicly available functionality
   •    is an interface
   •    is implemented as service in OSGi
   •    Example: IDataAggregate, IDataSourceService

• SPI (Service Provider Interface)
   •    is defining the extension point
   •    is implemented as service in OSGi in a separate bundle
   •    Example: IDataSource, IDataAggregator




   Page 17   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 18   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Versioning in OSGi

• Bundles and exported packages are versioned
• Usage of versioning is different for implementation, API,
  SPI
   •    Implementation: can be replaced easily, because interface is not changed
   •    API: can be evolved in a compatible way, but implementation has to be
        adapted, too
   •    SPI: evolution is difficult, because if interfaces are extended, then the old
        implementations are not valid any more
          • Java evolution: Ix  Ix2, e.g. IDataAggregator  IDataAggregator2 in the
            same package




   Page 19   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 20   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Testing

• Layers have to be separately testable
   •    Mock objects (Easy Mock)

• Example: DataAggregate layer




   Page 21   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Agenda

•   OSGi: basic structure and declaration
•   Interface Usage
•   Layers
•   Services and Layers
•   Versioning
•   Testing
•   Assemblies



    Page 22   OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
Multiple assemblies

• Bundles assembled into multiple assemblies (e.g.
  products)
• An assembly contains bundles from different layers
   •    A layer does not have to be used completely

• Examples:
   •    Other access layer (REST)
   •    Configuration data aggregator
   •    DSL data aggregator




   Page 23   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
Summary

• Module and service concepts should be used to
  structure software
• Bundles expose clear interfaces
• Communications works by using services (minimum
  requirement between layers)
• Layers are testable separately
• Different assemblies should be possible




  Page 29   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved

More Related Content

Similar to Structuring software systems with OSGi - Ulf Fildebrandt

Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher FrostVirgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frostmfrancis
 
Demystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarDemystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarKim Pike
 
Demystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarDemystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarEmtec Inc.
 
otbioverviewow13-141008094532-conversion-gate01-converted.pptx
otbioverviewow13-141008094532-conversion-gate01-converted.pptxotbioverviewow13-141008094532-conversion-gate01-converted.pptx
otbioverviewow13-141008094532-conversion-gate01-converted.pptxSreekumarSasikumar
 
Modernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsModernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsApigee | Google Cloud
 
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyer
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian MeyerA Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyer
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyermfrancis
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...mfrancis
 
OSGi Architecture for Mobile Device Software - Peter Kriens, aQute
OSGi Architecture for Mobile Device Software - Peter Kriens, aQuteOSGi Architecture for Mobile Device Software - Peter Kriens, aQute
OSGi Architecture for Mobile Device Software - Peter Kriens, aQutemfrancis
 
µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsmfrancis
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to PostgresEDB
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentSanjeeb Sahoo
 
OData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaSOData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaSSumit Sarkar
 
API Management: Unlock the Value of Your Unique Assets with a Robust API
API Management: Unlock the Value of Your Unique Assets with a Robust APIAPI Management: Unlock the Value of Your Unique Assets with a Robust API
API Management: Unlock the Value of Your Unique Assets with a Robust APISoftware AG
 
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...mfrancis
 
OSGi in the Residential Market
OSGi in the Residential Market OSGi in the Residential Market
OSGi in the Residential Market OSGiUsers
 
EDB's Migration Portal - Migrate from Oracle to Postgres
EDB's Migration Portal - Migrate from Oracle to PostgresEDB's Migration Portal - Migrate from Oracle to Postgres
EDB's Migration Portal - Migrate from Oracle to PostgresEDB
 
OpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel Alliance
 

Similar to Structuring software systems with OSGi - Ulf Fildebrandt (20)

Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher FrostVirgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
 
Demystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarDemystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud Webinar
 
Demystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud WebinarDemystifying the Cloud - BI Cloud Webinar
Demystifying the Cloud - BI Cloud Webinar
 
otbioverviewow13-141008094532-conversion-gate01-converted.pptx
otbioverviewow13-141008094532-conversion-gate01-converted.pptxotbioverviewow13-141008094532-conversion-gate01-converted.pptx
otbioverviewow13-141008094532-conversion-gate01-converted.pptx
 
Modernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsModernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIs
 
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyer
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian MeyerA Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyer
A Fault Tolerance Concept for Distributed OSGi Applications - Fabian Meyer
 
Otbi overview ow13
Otbi overview ow13Otbi overview ow13
Otbi overview ow13
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
 
OSGi Architecture for Mobile Device Software - Peter Kriens, aQute
OSGi Architecture for Mobile Device Software - Peter Kriens, aQuteOSGi Architecture for Mobile Device Software - Peter Kriens, aQute
OSGi Architecture for Mobile Device Software - Peter Kriens, aQute
 
Geode Meetup Apachecon
Geode Meetup ApacheconGeode Meetup Apachecon
Geode Meetup Apachecon
 
IBM Z for the Digital Enterprise - Zowe overview
IBM Z for the Digital Enterprise - Zowe overviewIBM Z for the Digital Enterprise - Zowe overview
IBM Z for the Digital Enterprise - Zowe overview
 
µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl pauls
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
 
OData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaSOData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaS
 
API Management: Unlock the Value of Your Unique Assets with a Robust API
API Management: Unlock the Value of Your Unique Assets with a Robust APIAPI Management: Unlock the Value of Your Unique Assets with a Robust API
API Management: Unlock the Value of Your Unique Assets with a Robust API
 
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...
2005 OSGi Alliance Status - John Barr, Ph.D., Past President, OSGi Alliance; ...
 
OSGi in the Residential Market
OSGi in the Residential Market OSGi in the Residential Market
OSGi in the Residential Market
 
EDB's Migration Portal - Migrate from Oracle to Postgres
EDB's Migration Portal - Migrate from Oracle to PostgresEDB's Migration Portal - Migrate from Oracle to Postgres
EDB's Migration Portal - Migrate from Oracle to Postgres
 
OpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component ModelOpenTravel XML Object Suite - Component Model
OpenTravel XML Object Suite - Component Model
 

More from mfrancis

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruumfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)mfrancis
 

More from mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Structuring software systems with OSGi - Ulf Fildebrandt

  • 1. Structuring Software Systems with OSGi Ulf Fildebrandt SAP AG 22.09.2011 OSGi Alliance Marketing © 2008-2010 . 1 Page COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved All Rights Reserved
  • 2. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 2 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 3. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 3 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 4. Principles of Modularity • Decoupling • Logic has to be decoupled, otherwise the structure evolves into a monolithic block („architecture erosion“) • Simplicity • Design the concepts as simple as possible, otherwise the system solves non- existing requirements • Extensibility • Decoupling implies that frameworks are open for logic • Extensibility for logic is not the exception, but rather the common principle for all frameworks Page 4 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 5. OSGi basics • Bundles are the atomic entities for structuring (containing binaries) • Services are the communication means between bundles • Exported packages are the public interface of bundles • Imported packages define the usages of bundles Page 5 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 6. Example • Web application to analyze data • OSGi bundles, services, and exported packages are used to structure the application Page 6 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 7. Structure of Application • Fulfills the business requirements, but no modularity (decoupling, extensibility) Servlet Data Data Source 1 Source 2 Page 7 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 8. Structure Of Application Servlet Data Aggregate Data Data Aggregator 1 Aggregator 2 Data Source 1 Data Source 2 Data Aggregator Interface Page 8 Data Source OSGi Alliance Marketing © 2008-2011 . All Rights Reserved Interface
  • 9. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 9 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 10. Interface Usage • Implementation should only use interfaces  Services in OSGi • Services are difficult to implement in OSGi fulfilling all lifecycle requirements (Service Tracker, Service Listener)  „boilerplate coding“ • Frameworks: Declarative Services (DS) is part of the OSGi specification, Blueprint, etc. • DS are meant to declare the dependencies of services and service usage • DS is a mechanism to bring dependency injection into OSGi Page 10 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 11. Structure Of Application Servlet IDataAggregate Data Aggregate Data Data Aggregator 1 Aggregator 2 Data Source 1 Data Source 2 IDataAggregator Data Aggregator Interface IDataSourceService IDataSource Page 11 Data Source OSGi Alliance Marketing © 2008-2011 . All Rights Reserved IDataItem Interface
  • 12. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 12 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 13. Layers • In architecture, layers are used to structure the software • Entities within a layer can only have dependencies to lower layers • Bundles in OSGi belong to one layer only • In reality more coarse grained frameworks are used • Feature (P2, Eclipse) • Application (Aries) • OSGi sub system specification • For simplicity in these examples only bundles are used Page 13 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 14. Servlet UI Data Aggregate Aggregate Aggregator Data Data Aggregator 1 Aggregator 2 Data Source 1 Data Source 2 Data Provider Data Aggregator Data Aggregator Interface Interface Data Source InterfaceAlliance Marketing © 2008-2011 . All Rights ReservedSource Page 14 OSGi Data Interface
  • 15. Class Structure • Classes fit to bundle structure Page 15 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 16. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 16 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 17. Interface of a Layer • Layers should have a clear interface • API (Application Programming Interface) • is defining the publicly available functionality • is an interface • is implemented as service in OSGi • Example: IDataAggregate, IDataSourceService • SPI (Service Provider Interface) • is defining the extension point • is implemented as service in OSGi in a separate bundle • Example: IDataSource, IDataAggregator Page 17 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 18. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 18 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 19. Versioning in OSGi • Bundles and exported packages are versioned • Usage of versioning is different for implementation, API, SPI • Implementation: can be replaced easily, because interface is not changed • API: can be evolved in a compatible way, but implementation has to be adapted, too • SPI: evolution is difficult, because if interfaces are extended, then the old implementations are not valid any more • Java evolution: Ix  Ix2, e.g. IDataAggregator  IDataAggregator2 in the same package Page 19 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 20. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 20 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 21. Testing • Layers have to be separately testable • Mock objects (Easy Mock) • Example: DataAggregate layer Page 21 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 22. Agenda • OSGi: basic structure and declaration • Interface Usage • Layers • Services and Layers • Versioning • Testing • Assemblies Page 22 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
  • 23. Multiple assemblies • Bundles assembled into multiple assemblies (e.g. products) • An assembly contains bundles from different layers • A layer does not have to be used completely • Examples: • Other access layer (REST) • Configuration data aggregator • DSL data aggregator Page 23 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. Summary • Module and service concepts should be used to structure software • Bundles expose clear interfaces • Communications works by using services (minimum requirement between layers) • Layers are testable separately • Different assemblies should be possible Page 29 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved