This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Application Frameworks and the fly likes Can OSGi prevent bad practices in modular application design? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Can OSGi prevent bad practices in modular application design?" Watch "Can OSGi prevent bad practices in modular application design?" New topic
Author

Can OSGi prevent bad practices in modular application design?

Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi,

I'm wondering if OSGi helps to avoid or prevent bad practices like circular dependencies or access to private parts of a module which shouldn't be published to "consumers" of a module.

As I wrote in other posts here I only have practical experience with the module system of the NetBeans platform. So I only know that it can help you avoid for example the problems above which I would consider bad practices. Does OSGi also offer mechanisms to avoid this or even prevent "incorrect" usage of modules and dependencies?

Marco
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
From experience of using Eclipse Platform which uses OSGi, it can export only necessary packages.

For example, we have 2 modules, Module A and Module B. Module A has 10 packages, I can export only 5 packages, so Module B can access only those 5 packages.

About circular dependencies, IMO, we don't need a tool to prevent it to happen, it's wrong, and in most cases it's unacceptable.
If we use Eclipse we couldn't even compile if there are circular dependencies between projects.

OSGi may be able to prevent that to happen but for me that doesn't much necessary.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
 
 
subject: Can OSGi prevent bad practices in modular application design?