EJB - external lib or inside JSF project?
I'm packa开发者_运维问答ging my app as WAR archive. What are pros/cons of these two approaches:
- Keep EJB (beans, entities etc) as separate project and include into WAR as lib (*.jar file - WEB-INF/lib) during build?
- 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
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.
精彩评论