15

My question is pretty straightforward: What are the features of an application that force the developer to exploit OSGI-like system? What are the cases, when such a utility is unneeded?

Bubba88
  • 1,910
  • 20
  • 44

3 Answers3

9

I just posted the following link to another question (What does OSGi solve), but I think here it is an even better fit. Hal Hildebrand wrote a blog about why and when he thinks OSGi is helping your development/product.

The core essence of the (pretty long) post is that it helps especially when dealing with long running, complex enterprise projects. In particular in the long run, the benefit of having an enforced structure will pay out, but read for yourselves

EDIT: fixed broken link.

Community
  • 1
  • 1
Mirko Jahn
  • 1,282
  • 1
  • 9
  • 15
  • The 'read for yourselves' link is broken. Wayback machine copy: http://web.archive.org/web/20120720010714/http://www.tensegrity.hellblazer.com/2009/10/all-we-need-to-do-is-take-these-lies-and-make-them-true-somehow.html – Gilead Jan 16 '14 at 15:52
3

Use OSGI if you want some of:

  • a very modular code structure (extreme case : each install has a different set of modules/plugins)
  • to start/stop/upgrade a module without stopping the rest of the application
KLE
  • 23,689
  • 4
  • 56
  • 62
  • 2
    If you happen to write a Web-Browser in Java, would you use OSGI? – Bubba88 Oct 13 '09 at 07:49
  • @Bubba88 As a technical person, the constraints are generally given to me, I don't choose them in my job. If I was writing this for fun, I could choose ; then I would choose according to "do I want to learn OSGI?". So my answer would be **yes**, because OSGI is a very promising technology that has already gained wide adoption. – KLE Oct 13 '09 at 07:55
  • 3
    @Bubba88 - yes OSGi is a great fit for a web browser! Browsers need an extensible architecture with support for plugins that may be contributed by third parties at a later time; that's exactly what OSGi gives you. – Neil Bartlett Nov 12 '09 at 13:26
1

OSGi was designed in the early 2000s to support use cases around embedded devices. With OSGi you can exchange bundles (manifested jars) in a java program without restarting the java process. This simple thing adds lots of flexibility and complexity.

It seems nowadays OSGi has lost its relevance, especially in the enterprise and cloud native world.

i000174
  • 1,107
  • 10
  • 15
  • I hope you are aware that you have answered a 13 year old question with an answer you might have given 15 years ago. Exchanging bundles during runtime may have motivated the initial design of OSGi but its major value is that it enforces a modular design of your application with well defined support for versioning of the components. – Michael Lipp Mar 24 '23 at 21:19