This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Can OSGi prevent bad practices in modular application design?

 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!