What is OSGI?
If you are in the software industry, you might have heard the term OSGI. But most probably you might not heard about this. That does not mean that you don't need to know about it. OK. What really OSGI is?
OSGI stands for Open Services Gateway Initiative. But that does not tell about it (That's the way most of the definitions are :D). It is a Dynamic Module System for Java, which
Why you need OSGI?
If you are in the software industry, you might have heard the term OSGI. But most probably you might not heard about this. That does not mean that you don't need to know about it. OK. What really OSGI is?
OSGI stands for Open Services Gateway Initiative. But that does not tell about it (That's the way most of the definitions are :D). It is a Dynamic Module System for Java, which
- defines an architecture for modular application development.
- It allows you to break your application into multiple modules and thus more easily manage cross-dependencies between them.
Why you need OSGI?
From a developer's perspective, OSGi
offers the following advantages:
How OSGI works?
Similar to the Java Servlet and EJB specifications, the OSGi specification defines two things:
Developing on the OSGi platform means first building your application using OSGi APIs, then deploying it in an OSGi container
How to benefit from OSGI?
If you are a developer in the enterprise application domain, the OSGi container has such a low footprint that you can easily embed it into an enterprise application. For example, let's say you're developing a complex Web application. You want to break the application into multiple modules: one module for the view layer, another for the DAO layer, and a third module for the data access layer. Using an embedded OSGi container to manage the cross-dependencies of these modules would enable you to update your DAO layer (say from slow DAO to fast DAO) without restarting your application.
As long as your application is compliant with the OSGi specification it should be able to run in any OSGi-compliant container. Currently, there are three popular open source OSGi containers:
- You can install, uninstall, start, and stop different modules of your application dynamically without restarting the container.
- Your application can have more than one version of a particular module running at the same time.
- OSGi provides very good infrastructure for developing service-oriented applications, as well as embedded, mobile, and rich internet apps.
How OSGI works?
Similar to the Java Servlet and EJB specifications, the OSGi specification defines two things:
- a set of services that an OSGi container must implement
- a contract between the container and your application.
Developing on the OSGi platform means first building your application using OSGi APIs, then deploying it in an OSGi container
How to benefit from OSGI?
If you are a developer in the enterprise application domain, the OSGi container has such a low footprint that you can easily embed it into an enterprise application. For example, let's say you're developing a complex Web application. You want to break the application into multiple modules: one module for the view layer, another for the DAO layer, and a third module for the data access layer. Using an embedded OSGi container to manage the cross-dependencies of these modules would enable you to update your DAO layer (say from slow DAO to fast DAO) without restarting your application.
As long as your application is compliant with the OSGi specification it should be able to run in any OSGi-compliant container. Currently, there are three popular open source OSGi containers:
- Equinox is the reference implementation for the framework portion of the OSGi Service Platform Release 4. It is the modular Java runtime at the heart of the Eclipse IDE, and implements all of the mandatory and most of the optional features of the OSGi R4 specification.
- Knopflerfish is an open source implementation of the OSGi R3 and OSGi R4 specifications. Knopflerfish 2 implements all the mandatory features and some of the optional features defined in the R4 specification.
- Apache Felix is the open source OSGi container from the Apache Software Foundation. At the time of writing this container is not fully compliant with the OSGI R4 specification.
Looks like this is getting a bit complex. I will stop here and compile another tutorial on developing a sample OSGI application.
Comments
Post a Comment