lindelof
lindelof

Reputation: 35250

Patterns for deploying layered business applications written in Java

I'm working on a layered business application written in Java that should be packaged as an EAR file and deployed to a JBoss application server. There's a web-application layer, a service layer, a domain layer but no persistence layer. At least on paper.

What is the best practice for deploying the different layers? In our team we have a little religious war going on between:

Are there other possibilities I'm missing? What are the best practices in this area? Are there any online or offline resources I could consult about this?

Upvotes: 5

Views: 395

Answers (2)

Michael Wiles
Michael Wiles

Reputation: 21194

Whichever approach you choose, make sure you actually gain value out of it. In other words, don't serve the architectural principle (package/jar) let the architecture principle serve you.

You need to balance separation of concerns with efficiency. The more projects you have the more cumbersome things become, but if you have one project, that can also be cumbersome.

Look at your requirements, context and size of your application and decide which approach is going to serve you best.

Upvotes: 1

Zack Marrapese
Zack Marrapese

Reputation: 12091

In my company, we bundle each layer into its own JAR. Then we include it in a WAR.

If you don't have any EJBs that need managed, there's no real advantage to using an EAR over a WAR for deployment.

Upvotes: 4

Related Questions