SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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)
 

Último

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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!
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

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