• 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Java modules vs. OSGi?

 
Saloon Keeper
Posts: 7164
165
  • 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