karolkpl
karolkpl

Reputation: 2209

EJB - external lib or inside JSF project?

I'm packaging my app as WAR archive. What are pros/cons of these two approaches:

  1. Keep EJB (beans, entities etc) as separate project and include into WAR as lib (*.jar file - WEB-INF/lib) during build?
  2. Keep everything (ejb-s, jsf beans etc) in one project, so after build all would go to WEB_INF/classes

Is there any performance/security difference? I'm using GlassFish 3.1.1 WebProfile

Upvotes: 2

Views: 163

Answers (1)

BalusC
BalusC

Reputation: 1108802

There is really no performance/security difference for JARs in /WEB-INF/lib versus classes in /WEB-INF/classes. They end up in the same context and classloader anyway. Perhaps extracting the JAR and loading its classes into memory needs a few milliseconds more, but that's totally negligible.

Only maintainability and reusability is different here. When you put EJBs in a separate project, then you can more easily reuse them for other WARs and purposes without the need to copypaste classes.

Upvotes: 3

Related Questions