Templates for deploying multi-level business applications written in Java

I am working on a multi-level business application written in Java that needs to be packaged as an EAR file and deployed to a JBoss application server. There is a web application level, a service level, a domain level, but not a persistence level. At least on paper.

What is the best practice for deploying different layers? In our team, we are conducting a small religious war between:

  • Packing each layer in its own JAR file (for example, in its own Maven module) and adding each module in an EAR file, OR
  • Combine all elements into a single JAR file with each layer mapped to a package naming convention.

Are there any other features that I am missing? What are the best practices in this area? Are there any online or offline resources that I could consult about this?

+5
source share
2 answers

At my company, we merge each layer into our own JAR. Then we include it in the WAR.

Unless you have managed EJBs, there is no real advantage to using EAR for WAR for deployment.

+4
source

Whichever approach you take, make sure you really get the value. In other words, do not serve the architectural principle (package / jar) to serve you with the principles of architecture.

. , , , .

, , .

+1

All Articles