Fork me on GitHub

Wednesday, July 30, 2008

OSGi - Add dynamic modularity to your Java applications

Ever imagined, how the Plug and Play (PnP) devices have eased the way we use our electronic devices, especially our PCs and laptops? You purchase a TV tuner card (or any of your other favorite card), plug it into your PC's PCI/PCMCIA slot, and ... Viola! Your PC can now act as a TV! Now your expansion card has added the functionalities of a TV to your PC. You remove the card, and back - your PC has lost its functionality of the TV. To whichever PC, you plug this card in, it just adds the TV functionality!

Mmm! I am not going to talk on those expansion cards. But just imagine if we could get such a functionality in our Java applications. You develop modules similar to the TV tuner card, that you plug in, and your application will gain that additional functionality ... essentially modular!

And now imagine those "hot-swappable" capabilities - you plug in your USB web camera even while your PC is running, take a snap, plug it out- thats it!. Hmm... impressive! Can we get such functionality in Java Applications - add are remove modules on the fly - without restarts? The answer is a big YES! OSGi makes this possible.

What is OSGi?

OSGi stands for Open Services Gateway initiative. This doesn't pretty much explain about what it does. This abbreviation is a thing of the past, and the OSGi Alliance itself is trying to forget it. Now officially, its just a trademark with no special meaning. The shortest description given about OSGi is "Universal Middleware". Software that you write once and then can use in binary form universally: in many different platforms, many different industries, and for many different purposes.


The OSGi Environment
(from the article "The last mile of software deployment" at http://www.aqute.biz/resources/2002/lastmile.pdf)


OSGi is a component-based platform for developing applications in Java. The OSGi site describes it as "dynamic module system for Java". The official definition of OSGi (in its R4 Specifiations) describes OSGi as follows:
The OSGi Service Platform specification delivers an open, common architecture for service providers, developers, software vendors, gateway operators and equipment vendors to develop, deploy and manage services in a coordinated fashion. It enables an entirely new category of smart devices due to its flexible and managed deployment of services. OSGi specifications target settop boxes, service gateways, cable modems, consumer electronics, PCs, industrial computers, cars, mobile phones, and more. Devices that implement the OSGi specifications will enable service providers like telcos, cable operators, utilities, and others to deliver differentiated and valuable services over their networks.

Okay, enough! Its impressive! But, I am not going into its technical details now. You could just go to the references stated, especaially [1], and of course the OSGi R4.1 specifications.

Why OSGi?

OSGi is there to stay. Many industry players have already embraced it. It offers many advantages to faster development, component reuse, easy integration, and other runtime benefits. Adrian Colyer, CEO of SpringSource has written an excellent blog at [8] on why one should consider OSGi framework for the Java Development.

Apart from the benefits mentioned before, an important consideration for choosing up a framework would be its industry acceptance. OSGi is being adopted by almost all the major players of the industry. Its not just the hype, because OSGi has been there now for about a decade. OSGi came out with its initial R1 specifications back in 1998.

Any real world success stories?

Yes of course! Eclipse is just an excellent example of a successful system running on the dynamics of OSGi. From Eclipse version 3.0 onwards,eclipse is backed by the OSGi framework - Equinox (an OSGi framework implementation). In fact, equinox is one of the widely used and fully compliant OSGi framework implementation.

There are other success stories as well, but I am very lazy to write on them! Okey, you can find some here: http://www.mbeddedserver.com/partners/success_stories.html, and here: http://www.infoq.com/news/2008/01/osgi-success.

The OSGi Service Platform is a set of specifications that define an application model inside a VM. You can think of OSGi like a SOA (Service Oriented Architecture) inside a VM (Some even think beyond!). Inside a running VM, it is possible to install, start, stop, update and un-install applications. The VM never has to be stopped. The specifications have a very flexible and powerful management model that made it possible to use the specifications almost as is in Eclipse.

Equinox powers the dynamics of the Eclipse that enables it to have plugins and extensions to provide so many variety of features. You can find eclipse plugins for almost anything. But, one may argue that even systems like the Firefox allows plugin models without OSGi. Right! but the main point is integration and reusing the wheel. Will Firefox(or other model) support the mechanism as a platform that can be used to build your applications? OSGi already is build up as a framework that will support dynamism and plugin model. The plugins (bundles) will be ought to be coherent when the different components integrate, someting that is enforced by the OSGi framework.

A component bundle once tested is bound to work even in the integrated scenario. Of-course, OSGi is not the only answer, you can roll your own, or get others like the JBoss Microcontainer. But OSGi is already mature enough to support applications rangng from mobile applications to enterprise applications. SpringSource has already built an application server on top of OSGi (See [7]).

Now, if one could point at the failures of eclipse, with plugins, or why it needs a restarts and all, the answer is not simple. OSGi framework is good enough, but eclipse had been shifted to this platform, its evolving. It has to support hundreds of plugin developers. And frankly, eclipse is still not able to fully leverage the platform to its full. But from ground-up, if one could consider writing applications on OSGi, it would be worth investing some of your thoughts.
You can know more about OSGi and Eclipse at references [5] and [6].

Conclusion

As you could guess,... I am not that good at blogging. With this blog, I just want to emphasise that - OSGi is there and its happenning. No indepths of OSGi (Its already there written by some great authors, that I have reffered to at the end of this blog).

OSGi has evolved over the past decade, but it still requires a decent grabbing out. It has all the promises, lots of big players also into play. So if you are among those early adopters, you can definitely have a competitive advantage in building modular applications for a long run. So, if you are planning for a new project, all modular and dynamic, take time to think and invest some time for OSGi before rolling out your own solutions.

Whats Next?

In my coming blogs, I will be trying to give out a heads up with using OSGi, using it for the Web and tools that will help you to develop on OSGi.

References

0. http://www.osgi.org/Main/HomePage
1. http://www.osgi.org/About/Technology?section=2 = The OSGi Technical Overview written for the OSGi Alliance
2. http://www.aqute.biz/OSGi/Articles
3. http://www.aqute.biz/OSGi/Presentations
4. http://www.aqute.biz/OSGi/Resources
5. http://www.aqute.biz/OSGi/Eclipse
6. http://www.eclipse.org/equinox/
7. http://www.springsource.com/products/suite/applicationplatform
8. http://blog.springsource.com/main/2008/05/15/why-should-i-care-about-osgi-anyway/
9. http://www.osgi.org/blog/2006/03/eclipsecon-2006-osgi-on-rise.html
10.http://soa.sys-con.com/node/492519
11.http://soa.sys-con.com/node/577046
12.http://www.redmonk.com/jgovernor/2008/02/05/osgi-and-the-rise-of-the-stackless-stack-just-in-time/

Thursday, July 17, 2008

Shed the experience myth, get the most out of your employee

Summary "Get the most out of your employees". Industry freshers at companies are not given up task for a good time, thinking that they will not be able to handle it. Pre-convinced notion that they cannot simply handle such task until they become "experienced" holds back their actual capacity. This experience myth does not die there, but rather goes down the career line at every experience levels. How to come above this experience myth and get those young, smart talents with you? Read on ...

-----------------------------------------


How many time have you made that employee in your organization to under perform? Yes, this must have happened, not deliberately, but because of a myth that might have engulfed you, as with most of the managers – the experience myth.


The experience myth is one of the commonest form of myths that takes away much of the productivity of your valuable employees, even without much notice to it. You require smart, capable employees with you, who may add value to your organization, make your organizations outperform your competitors. So, you place ads for experienced and talented breeds of those people, while mentioning it very prominently - “Freshers need not apply” or at some other times, something similar. Even at other times, when those less experienced move ahead to appear at the interviews, your “experience” screening, quietly puts them off. How many time have you avoided the best of talents this way?


Many times, with such an experience screening, those young, smart talents are denied their most apt position. Often, such unfortunate less experienced candidates may be just lacking those formal industry experience, while they may be having a good hands-on experience that they have acquired during their academic studies as they went beyond their courses to understand those much needed industry experience. Sometimes, even worse happen to these unfortunates where their expertise on the subject and the extra-curricular knowledge won't show up in his academic report. Effectively, this genius student may be far better off than his fellow students who might have scored much above him. Even for other, they may have acquired those much needed experience while they were doing a job hunt, that they simply cannot put onto their CV. While this may be more applicable to knowledge workers, consider if this is true even for the others.


Now an industry fresher like this is not given a chance for a job, or a position befitting him because he is “fresher”. Just realize that he is just industry fresher, not fresher on the subjects of his study.


The, story doesn't end up here. Again down the career path, the same story holds true even when he climbs the "experience ladder". There are positions and tasks meant for people with x-years of industry experience. No matter how competent the employee is, he is not given that position or task, not even tried once. In effect, such down casted employees are performing tasks much below their capacities. The one who is capable of making strategic technical or business decision is made follow such decision from those “experienced” guys higher up. Sometimes, this has a serious side-effect. The employee recognizes the inferior leadership above him, that may frustrate him leading to further decline in employee output.


Has your organization been struck with this experience myth? Has it eaten away much of the productivity and talent pool that you have always wanted? Then, follow these simple remedies:

  • # Keep no pre-convinced notion on experience vs capability . Practice this during new hirings, or even for employee evaluations.
  • # Go through your organizational hierarchy and look out for those hidden talents and try to bring them up.
  • # Recognize the hidden talent in an employee by giving him as challenging tasks as he can, regardless of his position. Ask them for tasks they would like to take up. Give them tasks even beyond their experience level and see if they can do it. Measure his threshold, and thus evaluate him.
  • # This kind of employee evaluation will not be a task for a few days, but rather it should be a continuing process.
  • # Have frequent interactions and feedback - employee evaluation should be more frequent. Consider a three month cycle.

Get rid of this experience myth, and see how it improves the overall productivity of your organization. You may soon have a pool of those young smart talents with you. Getting to this practice will even attract more and more talents to your interview desks.