SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque (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
 

Semelhante 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
 

Semelhante 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

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
"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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
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
 
"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
 
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!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

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