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

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
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
 
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
 
"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
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Último (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
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
 
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
 
"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
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
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
 
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!
 
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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

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