Nico
Nico

Reputation: 1966

modular development

What would you recommend for modular development in Java. OSGI is great but it's support for JPA is pitiful. I would really like not to have to write yet another framework, but it seems inevitable.

Upvotes: 0

Views: 800

Answers (5)

Robin
Robin

Reputation: 24282

The answer to your question is very dependent on the application(s) you are building. Java EE, ESB and OSGi are all appropriate, modular deployment strategies to certain problems.

Building enterprise service oriented software, vs a pluggable client application are very different applications with different solutions.

I currently work on a project that makes usage of Java EE deployed services for the backend and an Eclipse/OSGi based rich client that consumes those services. The design and deployment is quite modular between backend services (Java EE), client based services (pure OSGi) and UI components (Eclipse plugins).

The largest factor to overcome with any of these technologies is understanding how they work and designing your applications appropriately to work within their constraints. As was already mentioned, classloading is a pretty consistent issue with any complex application in these environments, but understanding these issues up front will allow the software to be designed appropriately for the technology.

Usage of frameworks like Spring go a long way to writing code that will cut the dependency to the underlying technology, but still be able to take advantage of its unique features.

Upvotes: 0

reta
reta

Reputation: 836

I guess OSGi is the mainstream in nowadays Java EE. And it's right choice to build modular applications. Yes, there are some problems with platform maturity and acceptance but take look at the community efforts and will (SpringSource, Eclipse, for example) to make it better. The implementations are open sourced and many IDEs support OSGi development. I would suggest to adopt one of the OSGi implementations instead of developing own framework even with those limitations existing today.

Upvotes: 0

jassuncao
jassuncao

Reputation: 4777

I don't think the problem is lack of support in OSGI for JPA, but lack of support in JPA implementations for the OSGI classloader. Anyway I digress.

You may have success using OpenJPA with OSGI. The latest versions are already packed as OSGI bundles. I leave also this link that explains how to get OpenJPA working in Apache Felix.

Upvotes: 0

aberrant80
aberrant80

Reputation: 13016

Think about what you want to achieve and keep the conceptual as detached from technology as you can. Then try to look for technologies that can fit into what you're trying to achieve. If there isn't a set of technologies/tools/frameworks that meets what you need, do some re-thinking and find a spot somewhere in the middle for concept and implementation to meet.

Upvotes: 1

Tobias Langner
Tobias Langner

Reputation: 10828

The best aproach to modular development: think first, code later, refactor often. There's no framework / library in the world that can replace thinking.

Upvotes: 5

Related Questions