Project architecture/organization on Java EE application with EJB 3.0, JPA, Dynamic web projects on JBoss
Asked Answered
S

3

7

I have a webapp with different Dynamic Web Projects, each of them generally containing an EJB Project. We want to keep them interacting, as in using beans and classes from each other's EJBs through JNDI, sharing the same database or using their own. But we also want to be able to keep different projects on different servers.

What would be the right focus for this kind of project in terms of architecture and organization?

How should we use EARs? One EAR to rule them all and in the darkness bind them? (sorry, had to do that LOTR reference), or an EAR per server/web project, etc.?

Screenplay answered 7/1, 2009 at 12:58 Comment(0)
C
2

Disk space is cheap, but if you throw everything into a single EAR, your app server is liable to run them all, even if all you want is Service A. You're best breaking commonly used EJBs and deploying them in by themselves, and each individual service's components in their own EARs.

Then, using JBoss as an example, you can simply copy the artifacts right into the deploy directory of whatever server you want to run them on.

OrderManagement.ear InventoryManagement.ear StoreFront.ear

You can then have either all, some or nothing on any particular server.

Connor answered 9/1, 2009 at 20:11 Comment(0)
L
1

EJB's are meant to be modular, so depending on the service you want to provide you should provide a proper EAR to be deployed. Also, try using MBeans and deploy them as independent services. Management interfaces help a lot when debugging and testing.

Leninism answered 9/1, 2009 at 20:18 Comment(0)
G
1

Keep in mind bug fix/upgrade and regression testing scenarios. The more EJB modules you have in the same EAR, the more function points will need regression testing even if you fixed or added a new feature to only one of the modules.

Goodnatured answered 12/1, 2009 at 3:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.