开发者

EJB - external lib or inside JSF project?

I'm packa开发者_运维问答ging 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜