SlideShare a Scribd company logo
© Zühlke 2012
Tim Ward
Best Practices for
(Enterprise) OSGi
applications
23. March 2012
Slide 1
© Zühlke 2012
• Java Consultant
• 5 years at IBM developing WebSphere Application Server
• PMC member of the Apache Aries project
• Particularly interested in Bytecode weaving/generation, JPA,
EJBs, Blueprint Dependency injection, Declarative qualities of
service (e.g. transactions)
• Regular conference speaker
• JAX London, EclipseCon, Devoxx, Jazoon, OSGi Community Event
• Author of Enterprise OSGi in Action
• Early access available at http://www.manning.com/cummins
• All chapters complete
• See the Manning booth for discounts on this and many other books
Who is Tim Ward?
- @TimothyWard
BLT - A Brief Introduction to Tim Ward, OSGi and Particle Physics | Tim Ward 3. February 2012 Slide 2
© Zühlke 2012
Agenda
What is “Enterprise OSGi” and why do I need it?
How can I use OSGi in my Applications?
How should I use OSGi in my Applications?
Where can I learn more about OSGi?
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 3
© Zühlke 2012
• OSGi is a mature technology with a broad range of adoption
• Eclipse!
• Embedded systems
• Home automation
• Java EE Application Servers
• Enterprise OSGi is much newer (First release 2010)
• Primary focus to improve OSGi’s support for enterprise tools
• Widely available in Open Source and Commercial servers
What is “Enterprise OSGi” and why do I
need it?
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 4
© Zühlke 2012
• So simply put Enterprise OSGi is just OSGi applied to “Enterprise”
Applications
• OSGi Web applications
• Using databases from an OSGi framework
• Managed Transactions for OSGi bundles
• Remoting Services…
• But isn’t this what Java EE is for?
• Why is OSGi helpful?
What is “Enterprise OSGi” and why do I
need it? (2)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 5
© Zühlke 2012
• OSGi is used for many reasons, but a primary motivation is modularity
• Big systems are hard to maintain and understand because of the
relationships between components:
• Big applications are just as complicated as servers (and usually have
more external dependencies!)
What is “Enterprise OSGi” and why do I
need it? (3)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 6
© Zühlke 2012
• Have you ever found that you need to use a library class, but it depends
on another version of a library you were already using?
• Java has a flat classpath, so you can only have one version of the class
• If you can’t change the code you can be forced into using brittle
combinations of point releases
• OSGi has a classloader graph:
• It all just works!
Why else do I need OSGi?
BLT - A Brief Introduction to Tim Ward, OSGi and Particle Physics | Tim Ward 3. February 2012 Slide 7
© Zühlke 2012
• Lots of Application runtimes offer some support for OSGi applications
• WebSphere, Glassfish, Jboss, Geronimo, Karaf, Virgo, Aries…
• Most require little more than packaging your application as OSGi bundles
How can I use OSGi in my Applications?
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 8
JAR
Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.acme.my.bundle
Bundle-Version: 1.0.0
Import-Package: com.acme.useful.package,
com.acme.another.useful.package
Export-Package: com.acme.api.package
OSGi Bundle
Manifest
© Zühlke 2012
• In terms of scope OSGi bundles are like JARs with better isolation
• This is good, but how many Enterprise Applications are built as a single
JAR?
• The Java EE EAR exists to support multi-module applications
• Even WAR files have built in support for library JARs
• For a long time OSGi had no scope beyond the bundle
• Parallel solutions exist in Eclipse, Apache and several commercial servers
• A unified model is offered by OSGi Subsystems
How can I use OSGi in my Applications?
(2)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 9
© Zühlke 2012
Best Practices for (Enterprise)
OSGi applications
Tim Ward
How should I use OSGi in
my Applications?
Best practices for all OSGi applications
23. March 2012
Slide 10
Best Practices for (Enterprise) OSGi applications | Tim Ward
© Zühlke 2012
• Well designed Object Oriented code exhibits good modular properties
• Simple reuse and ability to switch implementation
• These properties rely on classes being Cohesive and loosely coupled
• From a modularity perspective OSGi bundles very similar
• To work well an OSGi Bundle should be cohesive and loosely coupled
• The bundle manifest is an excellent guide to how well designed the bundle
actually is
How should I use OSGi in my
Applications?
1. Bundle Hygiene
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 11
© Zühlke 2012
• Java developers learn to recognise tightly coupled code
• Casting to implementation
• Relying on side-effects and leftover state
• OSGi has similar warning signs
• We saw how code can be imported by Import-Package
• OSGi also offers Require-Bundle
• Require-Bundle is a bit like casting to an implementation type
• You don’t just care about API, but also where it comes from!
How should I use OSGi in my
Applications?
1 a) Avoid Tight Coupling
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 12
© Zühlke 2012
• Splitting behaviour across multiple Objects makes an API hard to use
• The same is true of packages in OSGi
• A split package is one that exists two or more bundles but contains
different classes in each
• The OSGi classloader allows packages to come from exactly one bundle
How should I use OSGi in my
Applications?
1 b) Do enough to be Cohesive
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 13
com.acme.api.b
my.api.B
com.acme.api.a
my.api.A
com.acme.impl The implementation
might get A or B,
but never both
© Zühlke 2012
• Doing too much in a class is as bad as doing too little
• It’s hard to use an API with too many methods and arguments
• It adds overhead and hurts performance
• It’s hard to maintain
• Bundles can suffer from the same problem
• Huge numbers of dependencies (Import-Package or Require-Bundle)
• Lots of exported packages (which one do I use?!?)
• If a manifest can be measured in megabytes you’re doing it wrong!
How should I use OSGi in my
Applications?
1 c) Don’t do too much in your bundle
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 14
© Zühlke 2012
• You’ve seen that bundles can have a version
• Package Exports can be versioned too
• Imports can declare a range of accepted versions
• Versioning properly makes bundles less brittle and easier to reuse
• Semantic versioning of packages allows clients to declare what function
they require
• Major version changes indicate that clients might be broken
• Minor version changes indicate backward compatible updates
• Micro version changes are for bug fixes
• Unversioned packages are like a box of chocolates…
How should I use OSGi in my
Applications?
2. Version Everything
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 15
© Zühlke 2012
• We saw how split packages can break client bundles
• If they are versioned properly then the client can make a choice
How should I use OSGi in my
Applications?
2. Version Everything (2)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 16
com.acme.api.b
my.api.B
2.0.0
com.acme.api
my.api.A
1.0.0
com.acme.impl
Import-Package:
my.api;version=“[1,2)”
© Zühlke 2012
• Java lacks a satisfactory way to get implementation Objects
• Using new introduces tight coupling
• Using a factory is better, but still couples you to the factory!
• OSGi has a service registry that bundles can use to collaborate
• Services are registered using their API, so clients don’t need to construct
them!
• Using services makes it much easier to reuse and swap bundles
How should I use OSGi in my
Applications?
3 a) Use Services for looser coupling
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012
com.acme.provider com.acme.client
Slide 17
© Zühlke 2012
• Sharing services relies on your bundles using the same version of the API
• In fact it relies on you both getting the API from the same bundle!
• If the same API is available from multiple bundles then the client might
see a different one to the service provider…
• API works best when it is substitutable
• Bundles that export API should import it too – this allows more sharing
How should I use OSGi in my
Applications?
3 b) Make services substitutable
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012
com.acme.provider
com.acme.api_1.0.0
com.acme.client
Slide 18
com.acme.api
1.0.0
com.acme.provider
com.acme.api_1.0.0
© Zühlke 2012
Best Practices for (Enterprise)
OSGi applications
Tim Ward
How should I use OSGi in
my Applications?
Best practices for Enterprise OSGi applications
23. March 2012
Slide 19
© Zühlke 2012
• OSGi is a very powerful environment, but it can be hard to use
• Many constructs are very low level
• This is great for embedded systems, but not always for enterprise apps!
• The Enterprise Specifications offer a number of helpful tools
• Dependency injection frameworks
• Data Access Services…
• Make sure you use them!
How should I use OSGi in my
Applications?
4. Don’t do it all yourself!
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 20
© Zühlke 2012
• Using an OSGi service properly is hard because they are dynamic
How should I use OSGi in my
Applications?
4 a) Accessing services
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 21
@Override
public void serviceChanged(ServiceEvent event)
{
ServiceReference ref = event.getServiceReference();
if (ls.get() == null && event.getType() == ServiceEvent.REGISTERED) {
ls.set((LogService) ctx.getService(ref));
} else if (ls.get() != null && event.getType() == ServiceEvent.UNREGISTERING
&&
ref == lr.get()) {
ref = ctx.getServiceReference(LogService.class.getName());
if (ref != null) {
ls.set((LogService) ctx.getService(ref));
lr.set(ref);
}
}
}
private BundleContext ctx;
private AtomicReference<LogService> ls = new
AtomicReference<LogService>();
private AtomicReference<ServiceReference> lr = new
AtomicReference<ServiceReference>();
public void start(BundleContext ctx) throws InvalidSyntaxException
{
this.ctx = ctx;
ctx.addServiceListener(this, "(objectClass=org.osgi.service.log.LogService)");
ServiceReference ref = ctx.getServiceReference(LogService.class.getName());
if (ref != null) {
ls.set((LogService) ctx.getService(ref));
lr.set(ref);
}
}
© Zühlke 2012
• There are several OSGi dependency injection containers that make using
services much easier
• Blueprint and Declarative Services are both OSGi standards
• Declarative Services is very lightweight
• Great for systems with simple wirings
• No damping of services (A good and bad thing!)
• Blueprint offers a Spring-like programming model
• Easy to set up and manage large injection graphs
• Service damping means beans are protected from the service lifecycle
How should I use OSGi in my
Applications?
4 a) Accessing services (2)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 22
© Zühlke 2012
Sample blueprint consuming a service:
Sample Declarative Services consuming a service:
How should I use OSGi in my
Applications?
4 a) Accessing services (3)
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 23
<blueprint>
<bean id=”myBean” class=”org.acme.impl.MyBean”>
<property name=”logService” ref=”logService” />
</bean>
<reference id=”logService”
interface=”org.osgi.service.log.LogService” />
</blueprint>
<component name=”myBean”>
<implementation class=”org.acme.impl.MyBean” />
<reference bind=”setLogService” cardinality=”1..1”
interface=”org.osgi.service.log.LogService”
policy=”static” unbind=”unsetLogService”
name=”logService” />
</component>
© Zühlke 2012
• JDBC and JPA are commonly used to access data
• Both rely on static factories and Classpath visibility to work
• Trying to use traditional access patterns leads to unpleasant hacks
• There are Standard ways to get hold of these things in OSGi
• The JDBC service uses DataSourceFactory services to create DataSources
• Your server may register managed DataSource sservices too
• The JPA service also uses the service registry to provide
EntityManagerFactory Objects
How should I use OSGi in my
Applications?
4 b) Accessing data
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 24
© Zühlke 2012
• Traditionally OSGi applications use the HttpService to register Servlets
• This is good if you have one or two servlets, but not for big web apps
• The Enterprise Specification defines Web Application Bundles
• Essentially they are WARs with OSGi metadata
• WABs allow you to reuse tools and expertise when moving to OSGi
• Many web frameworks are OSGi enabled too
• A very easy way to begin migrating to OSGi
How should I use OSGi in my
Applications?
4 c) Enterprise OSGi Web Applications
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 25
© Zühlke 2012
Best Practices for (Enterprise)
OSGi applications
Tim Ward
Summary
23. March 2012
Slide 26
© Zühlke 2012
• OSGi isn’t as hard as you’ve been led to believe!
• But it isn’t magic either, you need to use what it gives you
1. Keep your bundles tidy and well defined
i. Spaghetti bundles are just as bad as spaghetti code!
2. Use semantic versioning to keep control of your dependencies
3. Use the service registry to communicate between bundles in a simple,
decoupled way
4. Use the Enterprise specifications to avoid writing huge amounts of
boilerplate in your applications
Things to remember
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 27
© Zühlke 2012
• The OSGi specifications are available at http://www.osgi.org
• Apache Aries for implementations http://aries.apache.org/
• Manning have several good OSGi books
• Enterprise OSGi in Action – Get up and running with Web Apps,
Transactions, JPA, Remoting, IDEs and build tools
• OSGi in Action – Great examples and coverage of core OSGi and
compendium services
• OSGi in Depth – Detailed coverage of architectural patterns for OSGi
• If you go to the Manning stand there are big EclipseCon discounts
• OSGi Articles available at http://www.developerworks.com
Useful Resources
Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 28

More Related Content

What's hot

µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl pauls
mfrancis
 
Pivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxPivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptx
Sufyaan Kazi
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development Environments
Joel W. King
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
Bruno Borges
 
Pivotal spring boot-cloud workshop
Pivotal   spring boot-cloud workshopPivotal   spring boot-cloud workshop
Pivotal spring boot-cloud workshop
Sufyaan Kazi
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101
Sufyaan Kazi
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Bruno Borges
 
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
mfrancis
 
IBM and OpenStack: Collaboration Beyond the Code
IBM and OpenStack: Collaboration Beyond the CodeIBM and OpenStack: Collaboration Beyond the Code
IBM and OpenStack: Collaboration Beyond the Code
Daniel Krook
 
Case Study: Orange Labs & Cloud Foundry
 Case Study: Orange Labs & Cloud Foundry  Case Study: Orange Labs & Cloud Foundry
Case Study: Orange Labs & Cloud Foundry
Guillaume Berche
 
OpenPOWER update for Linux on Power revolution event
OpenPOWER update for Linux on Power revolution eventOpenPOWER update for Linux on Power revolution event
OpenPOWER update for Linux on Power revolution event
Mandie Quartly
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and Beyond
Simon Elisha
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
Carsten Ziegeler
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
Matt Stine
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
Bruno Borges
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
Shaun Smith
 
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
mfrancis
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native Applications
Sufyaan Kazi
 
Towards a modularity maturity model - osgi users forum uk 16-nov2011
Towards a modularity maturity model - osgi users forum uk 16-nov2011Towards a modularity maturity model - osgi users forum uk 16-nov2011
Towards a modularity maturity model - osgi users forum uk 16-nov2011
mfrancis
 

What's hot (20)

µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl pauls
 
Pivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptxPivotal microservices spring_pcf_skillsmatter.pptx
Pivotal microservices spring_pcf_skillsmatter.pptx
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development Environments
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
 
Pivotal spring boot-cloud workshop
Pivotal   spring boot-cloud workshopPivotal   spring boot-cloud workshop
Pivotal spring boot-cloud workshop
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
 
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
How To Build Large Scale Enterprise Applications Using OSGi - David Savage, P...
 
IBM and OpenStack: Collaboration Beyond the Code
IBM and OpenStack: Collaboration Beyond the CodeIBM and OpenStack: Collaboration Beyond the Code
IBM and OpenStack: Collaboration Beyond the Code
 
Case Study: Orange Labs & Cloud Foundry
 Case Study: Orange Labs & Cloud Foundry  Case Study: Orange Labs & Cloud Foundry
Case Study: Orange Labs & Cloud Foundry
 
OpenPOWER update for Linux on Power revolution event
OpenPOWER update for Linux on Power revolution eventOpenPOWER update for Linux on Power revolution event
OpenPOWER update for Linux on Power revolution event
 
To Microservices and Beyond
To Microservices and BeyondTo Microservices and Beyond
To Microservices and Beyond
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
 
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
Building Server-Side Eclipse based Web applications - Jochen Hiller, Principa...
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native Applications
 
Towards a modularity maturity model - osgi users forum uk 16-nov2011
Towards a modularity maturity model - osgi users forum uk 16-nov2011Towards a modularity maturity model - osgi users forum uk 16-nov2011
Towards a modularity maturity model - osgi users forum uk 16-nov2011
 

Viewers also liked

Better WebApp Development using OSGi - Raymond Auge
Better WebApp Development using OSGi - Raymond AugeBetter WebApp Development using OSGi - Raymond Auge
Better WebApp Development using OSGi - Raymond Auge
mfrancis
 
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de VreedeLessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
mfrancis
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
mfrancis
 
Asynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T WardAsynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T Ward
mfrancis
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
mfrancis
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Charters
mfrancis
 
Liberate your components with OSGi services - Alasdair Nottingham
Liberate your components with OSGi services - Alasdair NottinghamLiberate your components with OSGi services - Alasdair Nottingham
Liberate your components with OSGi services - Alasdair Nottingham
mfrancis
 
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
mfrancis
 

Viewers also liked (9)

Better WebApp Development using OSGi - Raymond Auge
Better WebApp Development using OSGi - Raymond AugeBetter WebApp Development using OSGi - Raymond Auge
Better WebApp Development using OSGi - Raymond Auge
 
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de VreedeLessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
 
Asynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T WardAsynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T Ward
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Charters
 
3.4
3.43.4
3.4
 
Liberate your components with OSGi services - Alasdair Nottingham
Liberate your components with OSGi services - Alasdair NottinghamLiberate your components with OSGi services - Alasdair Nottingham
Liberate your components with OSGi services - Alasdair Nottingham
 
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
What's new in the OSGi Enterprise Release 5.0 - David Bosschaert and Tim Diek...
 

Similar to Best Practices for (Enterprise) OSGi applications - Tim Ward

Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
David Bosschaert
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
mfrancis
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
mfrancis
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
Elian, I.
 
What's happening in the OSGi IoT Expert Group? - Tim Ward
What's happening in the OSGi IoT Expert Group? - Tim WardWhat's happening in the OSGi IoT Expert Group? - Tim Ward
What's happening in the OSGi IoT Expert Group? - Tim Ward
mfrancis
 
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
Sanjeeb Sahoo
 
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
Spring Dynamic Modules for OSGi by Example - Martin Lippert, ConsultantSpring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
mfrancis
 
practical-guide-to-modularity with Java osgi
practical-guide-to-modularity with Java osgipractical-guide-to-modularity with Java osgi
practical-guide-to-modularity with Java osgi
GabrielBran5
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
Yuriy Shapovalov
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
Knoldus Inc.
 
OSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application BundlesOSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application BundlesRob Davies
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Nuxeo
 
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
 
OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2pjhInovex
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Mariano Gonzalez
 
OSGi at eBay: JavaOne 2010
OSGi at eBay: JavaOne 2010OSGi at eBay: JavaOne 2010
OSGi at eBay: JavaOne 2010Sangjin Lee
 
Building Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C ZiegelerBuilding Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C Ziegeler
mfrancis
 

Similar to Best Practices for (Enterprise) OSGi applications - Tim Ward (20)

Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
 
OSGi at eBay
OSGi at eBayOSGi at eBay
OSGi at eBay
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
OSGi
OSGiOSGi
OSGi
 
What's happening in the OSGi IoT Expert Group? - Tim Ward
What's happening in the OSGi IoT Expert Group? - Tim WardWhat's happening in the OSGi IoT Expert Group? - Tim Ward
What's happening in the OSGi IoT Expert Group? - Tim Ward
 
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
 
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
Spring Dynamic Modules for OSGi by Example - Martin Lippert, ConsultantSpring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
 
practical-guide-to-modularity with Java osgi
practical-guide-to-modularity with Java osgipractical-guide-to-modularity with Java osgi
practical-guide-to-modularity with Java osgi
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
OSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application BundlesOSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application Bundles
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 
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,...
 
OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2OSGi in Action Chapter 1 and 2
OSGi in Action Chapter 1 and 2
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
 
OSGi at eBay: JavaOne 2010
OSGi at eBay: JavaOne 2010OSGi at eBay: JavaOne 2010
OSGi at eBay: JavaOne 2010
 
Building Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C ZiegelerBuilding Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C Ziegeler
 

More from mfrancis

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

More from mfrancis (20)

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

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Best Practices for (Enterprise) OSGi applications - Tim Ward

  • 1. © Zühlke 2012 Tim Ward Best Practices for (Enterprise) OSGi applications 23. March 2012 Slide 1
  • 2. © Zühlke 2012 • Java Consultant • 5 years at IBM developing WebSphere Application Server • PMC member of the Apache Aries project • Particularly interested in Bytecode weaving/generation, JPA, EJBs, Blueprint Dependency injection, Declarative qualities of service (e.g. transactions) • Regular conference speaker • JAX London, EclipseCon, Devoxx, Jazoon, OSGi Community Event • Author of Enterprise OSGi in Action • Early access available at http://www.manning.com/cummins • All chapters complete • See the Manning booth for discounts on this and many other books Who is Tim Ward? - @TimothyWard BLT - A Brief Introduction to Tim Ward, OSGi and Particle Physics | Tim Ward 3. February 2012 Slide 2
  • 3. © Zühlke 2012 Agenda What is “Enterprise OSGi” and why do I need it? How can I use OSGi in my Applications? How should I use OSGi in my Applications? Where can I learn more about OSGi? Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 3
  • 4. © Zühlke 2012 • OSGi is a mature technology with a broad range of adoption • Eclipse! • Embedded systems • Home automation • Java EE Application Servers • Enterprise OSGi is much newer (First release 2010) • Primary focus to improve OSGi’s support for enterprise tools • Widely available in Open Source and Commercial servers What is “Enterprise OSGi” and why do I need it? Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 4
  • 5. © Zühlke 2012 • So simply put Enterprise OSGi is just OSGi applied to “Enterprise” Applications • OSGi Web applications • Using databases from an OSGi framework • Managed Transactions for OSGi bundles • Remoting Services… • But isn’t this what Java EE is for? • Why is OSGi helpful? What is “Enterprise OSGi” and why do I need it? (2) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 5
  • 6. © Zühlke 2012 • OSGi is used for many reasons, but a primary motivation is modularity • Big systems are hard to maintain and understand because of the relationships between components: • Big applications are just as complicated as servers (and usually have more external dependencies!) What is “Enterprise OSGi” and why do I need it? (3) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 6
  • 7. © Zühlke 2012 • Have you ever found that you need to use a library class, but it depends on another version of a library you were already using? • Java has a flat classpath, so you can only have one version of the class • If you can’t change the code you can be forced into using brittle combinations of point releases • OSGi has a classloader graph: • It all just works! Why else do I need OSGi? BLT - A Brief Introduction to Tim Ward, OSGi and Particle Physics | Tim Ward 3. February 2012 Slide 7
  • 8. © Zühlke 2012 • Lots of Application runtimes offer some support for OSGi applications • WebSphere, Glassfish, Jboss, Geronimo, Karaf, Virgo, Aries… • Most require little more than packaging your application as OSGi bundles How can I use OSGi in my Applications? Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 8 JAR Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.acme.my.bundle Bundle-Version: 1.0.0 Import-Package: com.acme.useful.package, com.acme.another.useful.package Export-Package: com.acme.api.package OSGi Bundle Manifest
  • 9. © Zühlke 2012 • In terms of scope OSGi bundles are like JARs with better isolation • This is good, but how many Enterprise Applications are built as a single JAR? • The Java EE EAR exists to support multi-module applications • Even WAR files have built in support for library JARs • For a long time OSGi had no scope beyond the bundle • Parallel solutions exist in Eclipse, Apache and several commercial servers • A unified model is offered by OSGi Subsystems How can I use OSGi in my Applications? (2) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 9
  • 10. © Zühlke 2012 Best Practices for (Enterprise) OSGi applications Tim Ward How should I use OSGi in my Applications? Best practices for all OSGi applications 23. March 2012 Slide 10 Best Practices for (Enterprise) OSGi applications | Tim Ward
  • 11. © Zühlke 2012 • Well designed Object Oriented code exhibits good modular properties • Simple reuse and ability to switch implementation • These properties rely on classes being Cohesive and loosely coupled • From a modularity perspective OSGi bundles very similar • To work well an OSGi Bundle should be cohesive and loosely coupled • The bundle manifest is an excellent guide to how well designed the bundle actually is How should I use OSGi in my Applications? 1. Bundle Hygiene Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 11
  • 12. © Zühlke 2012 • Java developers learn to recognise tightly coupled code • Casting to implementation • Relying on side-effects and leftover state • OSGi has similar warning signs • We saw how code can be imported by Import-Package • OSGi also offers Require-Bundle • Require-Bundle is a bit like casting to an implementation type • You don’t just care about API, but also where it comes from! How should I use OSGi in my Applications? 1 a) Avoid Tight Coupling Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 12
  • 13. © Zühlke 2012 • Splitting behaviour across multiple Objects makes an API hard to use • The same is true of packages in OSGi • A split package is one that exists two or more bundles but contains different classes in each • The OSGi classloader allows packages to come from exactly one bundle How should I use OSGi in my Applications? 1 b) Do enough to be Cohesive Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 13 com.acme.api.b my.api.B com.acme.api.a my.api.A com.acme.impl The implementation might get A or B, but never both
  • 14. © Zühlke 2012 • Doing too much in a class is as bad as doing too little • It’s hard to use an API with too many methods and arguments • It adds overhead and hurts performance • It’s hard to maintain • Bundles can suffer from the same problem • Huge numbers of dependencies (Import-Package or Require-Bundle) • Lots of exported packages (which one do I use?!?) • If a manifest can be measured in megabytes you’re doing it wrong! How should I use OSGi in my Applications? 1 c) Don’t do too much in your bundle Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 14
  • 15. © Zühlke 2012 • You’ve seen that bundles can have a version • Package Exports can be versioned too • Imports can declare a range of accepted versions • Versioning properly makes bundles less brittle and easier to reuse • Semantic versioning of packages allows clients to declare what function they require • Major version changes indicate that clients might be broken • Minor version changes indicate backward compatible updates • Micro version changes are for bug fixes • Unversioned packages are like a box of chocolates… How should I use OSGi in my Applications? 2. Version Everything Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 15
  • 16. © Zühlke 2012 • We saw how split packages can break client bundles • If they are versioned properly then the client can make a choice How should I use OSGi in my Applications? 2. Version Everything (2) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 16 com.acme.api.b my.api.B 2.0.0 com.acme.api my.api.A 1.0.0 com.acme.impl Import-Package: my.api;version=“[1,2)”
  • 17. © Zühlke 2012 • Java lacks a satisfactory way to get implementation Objects • Using new introduces tight coupling • Using a factory is better, but still couples you to the factory! • OSGi has a service registry that bundles can use to collaborate • Services are registered using their API, so clients don’t need to construct them! • Using services makes it much easier to reuse and swap bundles How should I use OSGi in my Applications? 3 a) Use Services for looser coupling Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 com.acme.provider com.acme.client Slide 17
  • 18. © Zühlke 2012 • Sharing services relies on your bundles using the same version of the API • In fact it relies on you both getting the API from the same bundle! • If the same API is available from multiple bundles then the client might see a different one to the service provider… • API works best when it is substitutable • Bundles that export API should import it too – this allows more sharing How should I use OSGi in my Applications? 3 b) Make services substitutable Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 com.acme.provider com.acme.api_1.0.0 com.acme.client Slide 18 com.acme.api 1.0.0 com.acme.provider com.acme.api_1.0.0
  • 19. © Zühlke 2012 Best Practices for (Enterprise) OSGi applications Tim Ward How should I use OSGi in my Applications? Best practices for Enterprise OSGi applications 23. March 2012 Slide 19
  • 20. © Zühlke 2012 • OSGi is a very powerful environment, but it can be hard to use • Many constructs are very low level • This is great for embedded systems, but not always for enterprise apps! • The Enterprise Specifications offer a number of helpful tools • Dependency injection frameworks • Data Access Services… • Make sure you use them! How should I use OSGi in my Applications? 4. Don’t do it all yourself! Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 20
  • 21. © Zühlke 2012 • Using an OSGi service properly is hard because they are dynamic How should I use OSGi in my Applications? 4 a) Accessing services Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 21 @Override public void serviceChanged(ServiceEvent event) { ServiceReference ref = event.getServiceReference(); if (ls.get() == null && event.getType() == ServiceEvent.REGISTERED) { ls.set((LogService) ctx.getService(ref)); } else if (ls.get() != null && event.getType() == ServiceEvent.UNREGISTERING && ref == lr.get()) { ref = ctx.getServiceReference(LogService.class.getName()); if (ref != null) { ls.set((LogService) ctx.getService(ref)); lr.set(ref); } } } private BundleContext ctx; private AtomicReference<LogService> ls = new AtomicReference<LogService>(); private AtomicReference<ServiceReference> lr = new AtomicReference<ServiceReference>(); public void start(BundleContext ctx) throws InvalidSyntaxException { this.ctx = ctx; ctx.addServiceListener(this, "(objectClass=org.osgi.service.log.LogService)"); ServiceReference ref = ctx.getServiceReference(LogService.class.getName()); if (ref != null) { ls.set((LogService) ctx.getService(ref)); lr.set(ref); } }
  • 22. © Zühlke 2012 • There are several OSGi dependency injection containers that make using services much easier • Blueprint and Declarative Services are both OSGi standards • Declarative Services is very lightweight • Great for systems with simple wirings • No damping of services (A good and bad thing!) • Blueprint offers a Spring-like programming model • Easy to set up and manage large injection graphs • Service damping means beans are protected from the service lifecycle How should I use OSGi in my Applications? 4 a) Accessing services (2) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 22
  • 23. © Zühlke 2012 Sample blueprint consuming a service: Sample Declarative Services consuming a service: How should I use OSGi in my Applications? 4 a) Accessing services (3) Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 23 <blueprint> <bean id=”myBean” class=”org.acme.impl.MyBean”> <property name=”logService” ref=”logService” /> </bean> <reference id=”logService” interface=”org.osgi.service.log.LogService” /> </blueprint> <component name=”myBean”> <implementation class=”org.acme.impl.MyBean” /> <reference bind=”setLogService” cardinality=”1..1” interface=”org.osgi.service.log.LogService” policy=”static” unbind=”unsetLogService” name=”logService” /> </component>
  • 24. © Zühlke 2012 • JDBC and JPA are commonly used to access data • Both rely on static factories and Classpath visibility to work • Trying to use traditional access patterns leads to unpleasant hacks • There are Standard ways to get hold of these things in OSGi • The JDBC service uses DataSourceFactory services to create DataSources • Your server may register managed DataSource sservices too • The JPA service also uses the service registry to provide EntityManagerFactory Objects How should I use OSGi in my Applications? 4 b) Accessing data Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 24
  • 25. © Zühlke 2012 • Traditionally OSGi applications use the HttpService to register Servlets • This is good if you have one or two servlets, but not for big web apps • The Enterprise Specification defines Web Application Bundles • Essentially they are WARs with OSGi metadata • WABs allow you to reuse tools and expertise when moving to OSGi • Many web frameworks are OSGi enabled too • A very easy way to begin migrating to OSGi How should I use OSGi in my Applications? 4 c) Enterprise OSGi Web Applications Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 25
  • 26. © Zühlke 2012 Best Practices for (Enterprise) OSGi applications Tim Ward Summary 23. March 2012 Slide 26
  • 27. © Zühlke 2012 • OSGi isn’t as hard as you’ve been led to believe! • But it isn’t magic either, you need to use what it gives you 1. Keep your bundles tidy and well defined i. Spaghetti bundles are just as bad as spaghetti code! 2. Use semantic versioning to keep control of your dependencies 3. Use the service registry to communicate between bundles in a simple, decoupled way 4. Use the Enterprise specifications to avoid writing huge amounts of boilerplate in your applications Things to remember Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 27
  • 28. © Zühlke 2012 • The OSGi specifications are available at http://www.osgi.org • Apache Aries for implementations http://aries.apache.org/ • Manning have several good OSGi books • Enterprise OSGi in Action – Get up and running with Web Apps, Transactions, JPA, Remoting, IDEs and build tools • OSGi in Action – Great examples and coverage of core OSGi and compendium services • OSGi in Depth – Detailed coverage of architectural patterns for OSGi • If you go to the Manning stand there are big EclipseCon discounts • OSGi Articles available at http://www.developerworks.com Useful Resources Best Practices for (Enterprise) OSGi applications | Tim Ward 23. March 2012 Slide 28