开发者

Does an EJB project typically contain only one Enterprise JavaBean or a collection of them?

开发者 https://www.devze.com 2023-01-07 17:24 出处:网络
I\'m working with IBM Rational Application Developer for WebSphere; it is based on Eclips开发者_如何转开发e, though I\'m not sure of its differences from Eclipse\'s Java EE features.

I'm working with IBM Rational Application Developer for WebSphere; it is based on Eclips开发者_如何转开发e, though I'm not sure of its differences from Eclipse's Java EE features.

I want to have two Enterprise JavaBeans. Do I create two separate EJB projects, one per JavaBean, or do I put them as different classes in one project?

What are the considerations when deciding between these, assuming that either is technically possible? What are the reasons to separate them or put them together in one project?


I want to have two Enterprise JavaBeans. Do I create two separate EJB projects, one per JavaBean, or do I put them as different classes in one project?

You can have several EJBs per EJB module (thanks god).

What are the considerations when deciding between these, assuming that either is technically possible?

I would say packaging/deployment considerations. If for whatever reason you want to be able to assemble and deploy only one of these EJB in an Enterprise App, then provide separate modules.

The rule of thumb is to regroup things logically into a same deployable unit. Split a logical group into finer grained modules only if special deployment needs arise (rare).

See also

  • 7.2 Packaging J2EE Applications
  • Packaging EJB 3 Applications
  • EJB modules
  • EJB 3.0 module packaging overview
0

精彩评论

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

关注公众号