SlideShare una empresa de Scribd logo
1 de 18
OSGi
The Dynamic Module System for JavaTM
OSGi Motivation
 Growing complexity requires not only highly modular
code, but also systems that are dynamically extensible
 Because there should be simpler way to construct software
systems than writing , writing, and writing …
 No matter which problem domain is your area of concern
◦ Embedded systems need to adapt to changing requirements even
though they are deployed out in the field
◦ Server applications must be configurable and manageable
without down time
◦ Client applications must respond to user desires for new
functionality instantaneously
OSGi Problems to Adders
 Lack of Portability
 Stale Devices
 Software Size
 Software Complexity
 Limits OO Technology
 Quality of Service
OSGi Background
 Started as an embedded platform for the “home
gateway”
 Originally under the JCP as JSR-8 (1999)
 Maintained by OSGi alliance, consists of a large
number of big companies.
 Current version: OSGi Release 4.2 (JSR-294)
OSGi Introduction
 An interesting platform for creating dynamically
extensible applications
 Provides a service-oriented, component based
environment
 Offers standardized ways to manage the
software lifecycle.
 OSGi technology is Universal Middleware.
OSGi What we can achieve
 Resolves many deficiencies associated with
conventional approaches for modularity and
dynamism
◦ Provide a module concept
 Explicit sharing of code (i.e., importing and exporting)
◦ Automatic management of code dependencies
 Enforces sophisticated consistency rules for class
loading
◦ Life-cycle management
 Manages dynamic deployment and configuration
OSGi Architectural Overview
OSGi Framework Layers
L3 - publish/find/bind service model to
decouple bundles
L2 - independent life-cycle of bundles without
JVM restarts
L1 - a module (or bundle) uses classes from
other bundles in a controlled way
L0 - well defined profiles that define the
environment in which bundles can work
OSGi Module
Layer
 Unit of deployment is bundle, a JAR
 Separate class loader per bundle
 Multi-version support (side-by-side)
 Explicit code boundaries and
dependencies
 Metadata in the manifest
 Automatic wiring based on version
ranges
OSGi Life-cycle
Layer
 Managed life cycle
◦ States for each bundle;
 Allows updates of existing
bundles.
◦ Dynamically
install, start, update, and
uninstall
OSGi Service
Layer
 Service interfaces allow bundles to
interact by binding interfaces, not
implementations
 Publish/find/bind intra-VM service
model
OSGi Dynamic Service Lookup
OSGi Framework
Provided Service
Provided Package
install
bundle.jar
Automatic package
dependency resolution
Manual service
dependency resolution
Existing
Bundle
Installed
Bundle
Resolv
-ed
Bundle
resolve bundle
OSGi OSGi Service Advantages
 Lightweight services
◦ Direct method invocation
 Good design practice
◦ Separates interface from implementation
◦ Enables reuse, substitutability, loose coupling, and late binding
 Dynamic
◦ Loose coupling and late binding make it possible to support run-
time dynamism
 Application's configuration is simply the set of
deployed bundles
◦ Deploy only the bundles that you need
OSGi Paint Program
 Create a simple Swing-based paint program
 Define a SimpleShape interface to draw shapes
◦ Different implementations of SimpleShape can be
created to draw different shapes
◦ Each shape has name and icon properties
◦ Available shapes are displayed in tool bar
 To draw a shape, click on its button and then
click in the drawing canvas
◦ Shapes can be dragged, but not resized
 Support dynamic deployment of shapes
OSGi High Level ArchitectureBest practice – Try to
centralize interaction
with OSGi API so that
other components
remain POJOs...only
Shape Tracker will
interact with OSGi API.
Best practice – Do not
make assumptions
about threads...since we
are creating a Swing
application, Shape
Tracker sends events on
Swing thread.
Main application
window – gets
dynamically injected
with available shapes
from the Shape
Tracker..
Actual shape
implementation.
Injected “proxied” shape
implementation to hide
aspects of dynamism
and provide a default
implementation.
Component that draws the
shape in parent frame; looks
up shape via Drawing Frame
rather than having a direct
reference..
OSGi
DEMO
OSGi Adoption
 Applications can leverage OSGi
functionality in two ways
◦ Bundled application
 Build entire application as a set of bundles that will
run on top of a framework instance
◦ Hosted framework
 Host a framework instance inside the application
and externally interact with bundles/services
OSGi Adoption (Bundled vs Hosted)
 Building your application as a set of bundles is
the preferred approach
◦ Allows all parts of application to benefit from OSGi
modularity and dynamism
◦ Allows application to run on any framework
◦ However, it is not always possible to bundle
application, e.g., legacy situations
 Hosted framework approach allows piecemeal
OSGi adoption
◦ Will likely tie application to a framework
implementation

Más contenido relacionado

La actualidad más candente

Micro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JETMicro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JETVijay Nair
 
OSGi Overview TomTom DevDay May 2009
OSGi Overview TomTom DevDay May 2009OSGi Overview TomTom DevDay May 2009
OSGi Overview TomTom DevDay May 2009Toralf Richter
 
How to Build Composite Applications with PRISM
How to Build Composite Applications with PRISMHow to Build Composite Applications with PRISM
How to Build Composite Applications with PRISMDataLeader.io
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiRafik HARABI
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...tdc-globalcode
 
Java Script from Browser to Server
Java Script from Browser to ServerJava Script from Browser to Server
Java Script from Browser to ServerWSO2
 
Build your own dev tools with salesforce cli plugin generator
Build your own dev tools with salesforce cli plugin generatorBuild your own dev tools with salesforce cli plugin generator
Build your own dev tools with salesforce cli plugin generatorMohith Shrivastava
 
Tutorial introduction to OSGi
Tutorial introduction to OSGiTutorial introduction to OSGi
Tutorial introduction to OSGiPaul Bakker
 
JasForge : the collaborative agile project
JasForge : the collaborative agile projectJasForge : the collaborative agile project
JasForge : the collaborative agile projectJasmine Conseil
 
Build Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesBuild Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesWes Yanaga
 

La actualidad más candente (18)

Liferay
LiferayLiferay
Liferay
 
Micro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JETMicro Front Ends for Micro Services using Oracle JET
Micro Front Ends for Micro Services using Oracle JET
 
OSGi Overview TomTom DevDay May 2009
OSGi Overview TomTom DevDay May 2009OSGi Overview TomTom DevDay May 2009
OSGi Overview TomTom DevDay May 2009
 
How to Build Composite Applications with PRISM
How to Build Composite Applications with PRISMHow to Build Composite Applications with PRISM
How to Build Composite Applications with PRISM
 
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter LehtoJavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
Liferay
LiferayLiferay
Liferay
 
Java Script from Browser to Server
Java Script from Browser to ServerJava Script from Browser to Server
Java Script from Browser to Server
 
Build your own dev tools with salesforce cli plugin generator
Build your own dev tools with salesforce cli plugin generatorBuild your own dev tools with salesforce cli plugin generator
Build your own dev tools with salesforce cli plugin generator
 
Tutorial introduction to OSGi
Tutorial introduction to OSGiTutorial introduction to OSGi
Tutorial introduction to OSGi
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Java fx
Java fx Java fx
Java fx
 
Liferay
LiferayLiferay
Liferay
 
Yii framework
Yii frameworkYii framework
Yii framework
 
JasForge : the collaborative agile project
JasForge : the collaborative agile projectJasForge : the collaborative agile project
JasForge : the collaborative agile project
 
Build Apps Using Dynamic Languages
Build Apps Using Dynamic LanguagesBuild Apps Using Dynamic Languages
Build Apps Using Dynamic Languages
 
Liferay on docker
Liferay on dockerLiferay on docker
Liferay on docker
 

Destacado (9)

Community and Social Change in ASRH Programs Strategies For Measuring Change
Community and Social Change in ASRH Programs Strategies For Measuring ChangeCommunity and Social Change in ASRH Programs Strategies For Measuring Change
Community and Social Change in ASRH Programs Strategies For Measuring Change
 
Aimsory
AimsoryAimsory
Aimsory
 
Unit 3
Unit 3Unit 3
Unit 3
 
Argh Lessons
Argh LessonsArgh Lessons
Argh Lessons
 
Each One Invites Three (EOI3) Approach Orientation
Each One Invites Three (EOI3) Approach OrientationEach One Invites Three (EOI3) Approach Orientation
Each One Invites Three (EOI3) Approach Orientation
 
Cloud storage
Cloud storageCloud storage
Cloud storage
 
Unit 3
Unit 3Unit 3
Unit 3
 
Family planning when “green” is queen: Exploring the potential for fertility ...
Family planning when “green” is queen: Exploring the potential for fertility ...Family planning when “green” is queen: Exploring the potential for fertility ...
Family planning when “green” is queen: Exploring the potential for fertility ...
 
Portfolio Passport
Portfolio PassportPortfolio Passport
Portfolio Passport
 

Similar a Dynamic Module System for Java Applications

OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...IndicThreads
 
OSGi User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC MetropjhInovex
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1pjhInovex
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgiYunChang Lee
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OpenBlend society
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
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
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Reviewnjbartlett
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.Elian, I.
 
OSGi Community Event 2010 - App Store for the Connected Home Services
OSGi Community Event 2010 - App Store for the Connected Home ServicesOSGi Community Event 2010 - App Store for the Connected Home Services
OSGi Community Event 2010 - App Store for the Connected Home Servicesmfrancis
 
OSGi Sticker Shock Eclipse Con 2010
OSGi Sticker Shock   Eclipse Con 2010OSGi Sticker Shock   Eclipse Con 2010
OSGi Sticker Shock Eclipse Con 2010ericjohnson
 
Modular Java EE in the Cloud
Modular Java EE in the CloudModular Java EE in the Cloud
Modular Java EE in the CloudBert Ertman
 
OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013mfrancis
 

Similar a Dynamic Module System for Java Applications (20)

OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
 
OSGi User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC Metro
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgi
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
GlassFish v3 - Architecture
GlassFish v3 - ArchitectureGlassFish v3 - Architecture
GlassFish v3 - Architecture
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
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
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Intro to OSGi
Intro to OSGiIntro to OSGi
Intro to OSGi
 
Pro syst about us
Pro syst   about usPro syst   about us
Pro syst about us
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
OSGi Community Event 2010 - App Store for the Connected Home Services
OSGi Community Event 2010 - App Store for the Connected Home ServicesOSGi Community Event 2010 - App Store for the Connected Home Services
OSGi Community Event 2010 - App Store for the Connected Home Services
 
OSGi tech session
OSGi tech sessionOSGi tech session
OSGi tech session
 
OSGi Sticker Shock Eclipse Con 2010
OSGi Sticker Shock   Eclipse Con 2010OSGi Sticker Shock   Eclipse Con 2010
OSGi Sticker Shock Eclipse Con 2010
 
Modular Java EE in the Cloud
Modular Java EE in the CloudModular Java EE in the Cloud
Modular Java EE in the Cloud
 
OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013
 

Último

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
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
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
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
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
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
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Último (20)

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
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
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
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
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
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
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

Dynamic Module System for Java Applications

  • 1. OSGi The Dynamic Module System for JavaTM
  • 2. OSGi Motivation  Growing complexity requires not only highly modular code, but also systems that are dynamically extensible  Because there should be simpler way to construct software systems than writing , writing, and writing …  No matter which problem domain is your area of concern ◦ Embedded systems need to adapt to changing requirements even though they are deployed out in the field ◦ Server applications must be configurable and manageable without down time ◦ Client applications must respond to user desires for new functionality instantaneously
  • 3. OSGi Problems to Adders  Lack of Portability  Stale Devices  Software Size  Software Complexity  Limits OO Technology  Quality of Service
  • 4. OSGi Background  Started as an embedded platform for the “home gateway”  Originally under the JCP as JSR-8 (1999)  Maintained by OSGi alliance, consists of a large number of big companies.  Current version: OSGi Release 4.2 (JSR-294)
  • 5. OSGi Introduction  An interesting platform for creating dynamically extensible applications  Provides a service-oriented, component based environment  Offers standardized ways to manage the software lifecycle.  OSGi technology is Universal Middleware.
  • 6. OSGi What we can achieve  Resolves many deficiencies associated with conventional approaches for modularity and dynamism ◦ Provide a module concept  Explicit sharing of code (i.e., importing and exporting) ◦ Automatic management of code dependencies  Enforces sophisticated consistency rules for class loading ◦ Life-cycle management  Manages dynamic deployment and configuration
  • 8. OSGi Framework Layers L3 - publish/find/bind service model to decouple bundles L2 - independent life-cycle of bundles without JVM restarts L1 - a module (or bundle) uses classes from other bundles in a controlled way L0 - well defined profiles that define the environment in which bundles can work
  • 9. OSGi Module Layer  Unit of deployment is bundle, a JAR  Separate class loader per bundle  Multi-version support (side-by-side)  Explicit code boundaries and dependencies  Metadata in the manifest  Automatic wiring based on version ranges
  • 10. OSGi Life-cycle Layer  Managed life cycle ◦ States for each bundle;  Allows updates of existing bundles. ◦ Dynamically install, start, update, and uninstall
  • 11. OSGi Service Layer  Service interfaces allow bundles to interact by binding interfaces, not implementations  Publish/find/bind intra-VM service model
  • 12. OSGi Dynamic Service Lookup OSGi Framework Provided Service Provided Package install bundle.jar Automatic package dependency resolution Manual service dependency resolution Existing Bundle Installed Bundle Resolv -ed Bundle resolve bundle
  • 13. OSGi OSGi Service Advantages  Lightweight services ◦ Direct method invocation  Good design practice ◦ Separates interface from implementation ◦ Enables reuse, substitutability, loose coupling, and late binding  Dynamic ◦ Loose coupling and late binding make it possible to support run- time dynamism  Application's configuration is simply the set of deployed bundles ◦ Deploy only the bundles that you need
  • 14. OSGi Paint Program  Create a simple Swing-based paint program  Define a SimpleShape interface to draw shapes ◦ Different implementations of SimpleShape can be created to draw different shapes ◦ Each shape has name and icon properties ◦ Available shapes are displayed in tool bar  To draw a shape, click on its button and then click in the drawing canvas ◦ Shapes can be dragged, but not resized  Support dynamic deployment of shapes
  • 15. OSGi High Level ArchitectureBest practice – Try to centralize interaction with OSGi API so that other components remain POJOs...only Shape Tracker will interact with OSGi API. Best practice – Do not make assumptions about threads...since we are creating a Swing application, Shape Tracker sends events on Swing thread. Main application window – gets dynamically injected with available shapes from the Shape Tracker.. Actual shape implementation. Injected “proxied” shape implementation to hide aspects of dynamism and provide a default implementation. Component that draws the shape in parent frame; looks up shape via Drawing Frame rather than having a direct reference..
  • 17. OSGi Adoption  Applications can leverage OSGi functionality in two ways ◦ Bundled application  Build entire application as a set of bundles that will run on top of a framework instance ◦ Hosted framework  Host a framework instance inside the application and externally interact with bundles/services
  • 18. OSGi Adoption (Bundled vs Hosted)  Building your application as a set of bundles is the preferred approach ◦ Allows all parts of application to benefit from OSGi modularity and dynamism ◦ Allows application to run on any framework ◦ However, it is not always possible to bundle application, e.g., legacy situations  Hosted framework approach allows piecemeal OSGi adoption ◦ Will likely tie application to a framework implementation