• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java modules vs. OSGi?

 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having had some exposure to OSGi (and having found it useful in some specialized circumstances) I'd be curious to know what your view is on the differences. Do you see both as competing or complementary? In which situation would you use one of them rather than the other?
 
Greenhorn
Posts: 17
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know OSGi very well, so take what I say with a big grain of salt.

Yes, the module system and OSGi have a lot of conceptual overlap. Both turn JARs into modules/bundles by giving them names and letting them define APIs and express dependencies. OSGi goes beyond that, though. It's service model is more refined and it allows bundles to appear and disappear at run time, something Java's module system doesn't even dream of. If you use any of OSGi's more advanced features, there's a fair chance that the module system isn't powerful enough for you. Otherwise, I would prefer the module system because it is better integrated into the platform and tooling (although the latter may take a little more time to mature).

For what it's worth, Sander Mak, OSGi and JPMS expert, agrees - see here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic