Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

OSGi Use Cases

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recently I've been reading about OSGi. What I've understood from my reading is that OSGi offers modularity, 'encapsulation' at the jar level, and 'hot-plugability.' But what I've not been able to discern is when is it 'appropriate' to use OSGi. For example, I have an Http Service that I implemented using CXF. Could I re-do the service using CXF over OSGi? If, yes what would need to change? Lastly, of the various implementations -- Flex, Equinox, Knopflerfish -- which one should I start with as I learn? Thanks.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Could I re-do the service using CXF over OSGi?


The question is phrased in a way that leads me to believe that you do not yet fully understand what OSGi is, and how it might be applied to a given application scenario. You probably could implement the WS using OSGi, but the salient question is - why would you? OSGi doesn't offer benefits that apply to every single use case; only once you know which problem you'd like to solve using OSGi can you make an informed decision if, and how, to use it.

Lastly, of the various implementations -- Flex, Equinox, Knopflerfish -- which one should I start with as I learn?


There's no "should". All of them implement OSGi; if you don't know enough about OSGi to discern their differences, then you might as well choose any one of them - they're all plenty mature enough.
 
Dan King
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:
The question is phrased in a way that leads me to believe that you do not yet fully understand what OSGi is, and how it might be applied to a given application scenario. You probably could implement the WS using OSGi, but the salient question is - why would you? OSGi doesn't offer benefits that apply to every single use case; only once you know which problem you'd like to solve using OSGi can you make an informed decision if, and how, to use it.



You're correct, I do not fully understand what OSGi is, nor do I fully understand which situations OSGi is suited for; the purpose of the original post was to find answers to both of those questions. So, going back to the WS example, while I could use OSGi, what criteria should I use to determine if i should use OSGi? Furthermore, if you have any example use cases that could demonstrate suitable situations for OSGi, I'd appreciate it if you could share those examples. Thanks.

 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once use case is managing plugins for an application. A while ago I wrote about how to do that in stock Java. All that fiddling with classloaders and security managers would be handled by OSGi if each plugin came as an OSGi bundle. And it would be easily possible to add/chabge/remove plugins at application runtime.

The https://coderanch.com/how-to/java/OSGiLinks page links to a few introductory articles that may be helpful.
 
You can't expect to wield supreme executive power just because
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic