CMR design


EJB design: CMR design

  1. CMR design (1 messages)

    Couple of general questions about CMR.

    Is it correct that CMR can only be used between ejb's declared in the same ejb.jar. I suspect that some application servers may provide proprietary extensions that allow CMR across ejb.jars but within an ear, however I'm looking to write portable CMR. So is it limited to ejb.jar or ear?

    Secondly, it has always been my understanding that entity beansare intended to be reusable buisiness objects across application domains. So for example, a customer entity bean could be use in an ordering application as well as a mailshot application. It seems to me that CMR pollutes entity beans with application specific relationships. For example, if I'd written the ordering system first I would have had a customer-order relationship and I would likely have defined relationship accessors methods in both the Customer and Order implementation classes (as well as their component interfaces and associated descriptor). Now when I want to reuse the Customer bean in the mailshot application I have all this ordering related stuff that I don't need.

    Am I missing a fundamental point here? Perhaps CMR is only intended to be used for tightly coupled components such as an order and order line as opposed to loosely couple components as above.

    Now CMR obviously alleviates the developer from having to implement join themselves and it also obviously is a lot wuicker to delegate the join approach to the persistence manager. So there are very obvious benefits to using CMR.

    So why place the application specific stuff in the specific entity ejb's? Why wasn't it designed to have the relations stuff in a session bean facade? This just seems do obvious to me that I must be overlooking something.

    Any clarification would be appreciated.

    Threaded Messages (1)

  2. CMR design[ Go to top ]

    Good questions.

    1. You can only have CMR relationships between Beans in the same jar! Yes this does seem somewhat limiting.

    2. Most of this stuff was discussed in the "Why I hate Entity Beans" thread a little while back: