Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Patterns for deploying layered business applications written in Java

Tags:

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:

  • Packaging each layer in its own JAR file (e.g. in its own Maven module), and adding each module to the EAR file, OR
  • Bundling everything together in a single JAR file, with each layer mapped to a package naming convention.

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?

like image 911
lindelof Avatar asked Jul 30 '09 12:07

lindelof


1 Answers

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.

like image 184
Zack Marrapese Avatar answered Oct 05 '22 14:10

Zack Marrapese