Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the underlying theme in OSGi?

Tags:

osgi

OSGi is a dynamic modular system for Java. Ok, but what is the base line theme, why was OSGi developed? What are the benifits of using OSGi? What is the main story of developing OSGi? Why does it exist?

like image 788
komal Avatar asked Nov 30 '09 09:11

komal


2 Answers

If you look closer, the concept of classpath in Java really sucks.

You distribute your classes in JAR files, but during runtime Java will (almost) blindly throw all the classes from all the JAR files into one big bag where classes with the same name overshadow each other and then interact in unexpected ways.

OSGi brings a proper runtime modularity to Java platform and on top of that a powerful service model, sometimes referred to as "SOA inside the JVM".

I would strongly recommend reading some introductory articles about OSGi that will give a more concrete idea of what this all means. A good starting point might be the series of articles on InfoQ about Java modularity by Alex Blewitt:

  • Modular Java: What Is It?
  • Modular Java: Static Modularity
  • Modular Java: Dynamic Modularity
like image 156
Pavol Juhos Avatar answered Sep 27 '22 21:09

Pavol Juhos


OSGi is

  • A module system for Java: it provides a way of exporting and importing Java packages and enforcing the module boundaries, including explicit dependency and version information.

  • A generalized container for Java systems: bundles can be dynamically loaded and unloaded without stopping the system, where "bundle" is basically jar file.

  • A service-oriented programming system: in addition to modularizing the system by packages, OSGi supports service-oriented modularity, including things like the whiteboard pattern (PDF).

OSGi was originally developed to support high-end embedded systems such as set-top boxes, which motivates the explicit dependencies and versioning, as well as making it fairly lightweight when used as a more recent, enterprise-side container.

like image 35
Tommy McGuire Avatar answered Sep 27 '22 19:09

Tommy McGuire