Eclipse Zone is brought to you in partnership with:

Kirk is a software developer who has filled most roles on the software developer team. He is the author of Java Design: Objects, UML, and Process (Addison-Wesley, 2002) and he contributed to No Fluff Just Stuff 2006 Anthology (Pragmatic Bookshelf, 2006). His most recent book, Java Application Architecture: Modularity Patterns with Examples Using OSGi was published in 2012. Kirk is a DZone Zone Leader and has posted 77 posts at DZone. You can read more from them at their website. View Full User Profile

A Recap on OSGi - Why and How?

02.20.2009
| 20428 views |
  • submit to reddit

Over the past several months, I’ve written quite a few blog entries about OSGi. Here’s a recap of those entries. If you’re not familar with OSGi, the posts under How OSGi might be of interest. If you’re familar with OSGi, but aren’t clear how it can help, the posts under Why OSGi will be of interest. And if you want to get a sense for where OSGi stands in the market today, the posts under OSGi Market may peak your fancy.

Why OSGi

Here are some posts that describe the motivating factors behind OSGi.

  • Rotting Design - Discusses how a system’s design tends to rot as change occurs, and what we can do about it. Introduces OSGi at the end of the post.
  • Java Components & OSGi - My first “official” OSGi post where I talk about JAR files as components on the Java platform.
  • Enterprise OSGi -The advantages of what OSGi will bring to Enterprise development. We certainly aren’t here yet, but this is the direction things are moving.
  • JAR Design over Class Design - An indication of how few development teams spend time designing JAR files. Very unfortunate, but true.

How OSGi

Here are some posts describing how to use OSGi. They are simple tutorials.

  • Simple OSGi Service - The simplest OSGi service just to show the basics of OSGi. A good “getting started” guide if you’re not familar with OSGi.
  • OSGi & Modularity - Uses the OSGi service registry and separates interface from implementation to create a module that can be replaced with another without restarting the system.
  • OSGi & Spring - Shows how Spring Dynamic Modules can be embedded in an OSGi runtime (Felix) and OSGi services registered with the service registry. Spring takes care of registering the services, so that application code has no dependencies on the OSGi API.
  • OSGi & Embedded Jetty - A simple tutorial showing how Jetty can be embedded in OSGi. The example is fully functional and can be checked out of my Google Code SVN repository. I used Felix for the example, but also tested it under Equinox.
  • Embedding OSGi in Tomcat - A tutorial that shows what’s necessary to embed OSGi in an application server. This is the inverse of OSGi and Embedded Jetty.

OSGi Market

Here are some posts on the OSGi market.

Late last year, I also published an in-depth research overview on OSGi. A Burton Group client subscription is required to access the report. The Wordle image embedded in this post shows the word cloud for that paper.

References
Published at DZone with permission of its author, Kirk Knoernschild. (source)
Tags:

Comments

Peder Madsen replied on Fri, 2009/02/20 - 5:10pm

Clicking the URL's seems to give a database connection error -->
Error establishing a database connection

Jeroen Wenting replied on Mon, 2009/02/23 - 2:04am

OSGi is JAH (Just Another Hype). It has all the symptoms: rapid adoption by people who don't know what it is, lots of publicity that doesn't show anything except telling how great it is (and usually using other identical publications as references), etc. etc..

Maybe in a few years when the dust has settled we'll see if it's still there and actively used in projects that aren't rotting corpses, left for dead by the wayside of software development and kept alive only because it's more expensive to let them die than to keep the morphine drip going.

Philippe Lhoste replied on Mon, 2009/02/23 - 5:54am

Both in this article, and in the supposedly introductory article (Simple OSGi Service), you fail to explain just what is OSGi: what the acronym means, how it can be useful, etc.

Perhaps it is simple, very common knowledge, and I am just an old under-informed programmer (not even in JEE business, even though I have some base knowledge of the field). Yet if you want to gain some more readers, a few introductory words could  help.

I can read on the OSGi.org site (which, to be honest, you link to in the first article): OSGi technology is the dynamic module system for Java™ — OSGi technology is Universal Middleware. OSGi technology provides a service-oriented, component-based environment for developers and offers standardized ways to manage the software lifecycle. which is nice marketing blurb but not very informative.

Not to diminish your work, just to make you aware of a little issue, unless you target only people already knowing what are "Felix, Spring Dynamic Modules, and Jetty, [and] Equinox".

Christopher Brind replied on Wed, 2009/02/25 - 4:42am in response to: Philippe Lhoste

Hi, I get asked that question quite a lot and decided to blog my response to save some time! :)

http://www.perplentropy.com/2008/10/osgi-primer.html

 

Mats Mortensen replied on Wed, 2009/02/25 - 4:47am

The way I have understood it:

  1. OSGi is a specification.
  2. The specification specifies how to build a runtime system for module based systems
  3. There are several systems that implements the specification. Equinox is one of them.
  4. Modules in OSGi are called "Bundles".

 Why is OSGi a Good Thing?

  1. It encourages modularization 
  2. Adding a component/bundle to an application using OSGi (for instance Equinox) does not require a recompile of your application. Basically helps you make your application easily pluggable.
  3. It can allow for reuse of components/bundles (even for completely unrelated applications)
  4. It allows for hot deployment of components/bundles
  5. It provides you with (relatively) easy ways to update components/bundles with new versions.


I like to think of it this way:

You can group your classes into packages. You can group your packages into jars. With an OSGi runtime you can now group your jars into bundles. Bundles can be configured to expose only the classes you want to expose and other bundles can depend on your bundle to use the classes you expose.

 

Peter Kriens replied on Fri, 2009/02/27 - 12:51pm

Hmm, this is the first time OSGi is combined with rapid adoption ... We've been working on this for more than ten years and I can ensure you it did not feel fast. I am not saying it is good for everything, on the contrary, I always try to be quite honest about the limitations. Therefore, it feels a tad unfair to call it just another hype.

About what OSGi is, last year I tried to answer this question again with the article that is linked from the OSGi home page. http://www.osgi.org/About/WhatIsOSGi If you think it is not clear, please let me know, I'll try to improve it.

The strange thing with OSGi is that on the web you find many introductions about OSGi, but they all seem hard to understand until you get it, after which most people write yet another introduction. I think OSGi is addressing an area that does not have a lot of reference points (yet), making it hard to grasp, unless you actually have used it. I often compare OSGi with modern plumbing. If you tried to explain modern plumbing and heated toilets in the dark ages, you probably would have gotten a lot of blank stares. Today we do not even think about it until the shit hits the fan. Or try closures, if you programmed for 25 years without them, what could they provide that you could not do today? That is, until you really used them after which you can't turn back.

We are trying really hard to create a specification that will make it easier for developers to create applications that collaborate with off the shelf or customized components. My personal involvement is very much driven from the vision of developing software with adaptive components. Of course it is nice that more and more people start to use it after all these years, and yes, I see people adopting it that should not adopt it yet. I see that there is still a lack of tooling that make it sometimes cumbersome to use for programmers that are used to work in a more established environment. Believe me, we are working hard on that, but after all we are a non-profit organization.

OSGi is the first specification that attempts to simplify software development by allowing us to work together in a better way. I think the adoption of OSGi by IBM Websphere, Oracle/BEA WebLogic, JBoss, Sun's Glassfish, Eclipse, LinkedIn, and Spring highlight that this is quite mature (these products are huge). Yes, you can write it off as a hype, you can also help make this vision a reality, we can't do it without massive adoption. Fortunately more and more people are doing that today, though not rapidly enough in my biased opinion. 

 Peter Kriens, OSGi Evangelist

Sigit Irawan replied on Fri, 2011/12/23 - 11:16am

thank you .for information about osgi .. i will keep reading them. thank for help them. paleo diet meal plan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.