3

I am working on a small Java EE application which also uses EJB's. It is a very small application with just a few beans.

Right now I am bundling the entire application in one war file. Would this be considered bad practice ? Should I create another project and resulting jar file for the EJB's ?

From a practical view point (besides being able to reuse the EJB's in multiple projects), what are the pros and cons of deploying everything in one war file vs. splitting them into war + jar files ?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Parag
  • 12,093
  • 16
  • 57
  • 75

1 Answers1

2

To respect the Java Multitiered architecture it's better to keep the EJB in a JAR. It's a better practice to separate the business logic from the Web tier. Then you can use EAR (check this too) for deployment. But if your application is small and will not grow up it's acceptable to put everything in a War.

Community
  • 1
  • 1
alain.janinm
  • 19,951
  • 10
  • 65
  • 112