-
1. Re: Entity EJB associations
alu1344 Jan 20, 2002 2:08 PM (in response to revitale1)IIRC what Sun J2EE Design Patterns says is that you shouldn't abuse on EJB relations (still talking about patterns prior to EJB 2.0 and CMR and local interfaces).
If I understand right, entity EJB relations are very related with business logic, so keeping them in session beans make sense; you make your business logic scalable and keeps complexity in just one bean. An example that I am programming right now:
I have a relation between beans A and B that was programmed as CMR. Now there should be a boolean value on this relation (call it "available") that modifies the relation itself. So I have to delete the CMR from the entity beans, make custom finders and displace the logic to session beans. Half the work would be done if I coded on session beans from the beginning (don't misunderstand me, I keep on CMR whenever I can).
As i see it, currently J2EE patterns are a bit outdated, and even more, some of them are against others.
Remember that in theory an entity EJB is supposed to only care about persistence. Using a Customer EJB to locate his Billing is something that was not intended. You can do it, but knowing that your bean can become innecesarily complex. -
2. Re: Entity EJB associations
jbossuser Jan 24, 2002 2:02 PM (in response to revitale1)How a container handles relationships is an important factor, for example when and how it goes about loading collections.
I like using CMR with low load, high business logic systems, for example a sales management application that monitors orders, sales leads, contacts etc. where no more than several dozen thousand people might hit the application occasionally during a given business week.
On the other hand, high end transaction processing systems that have constantly high loads and very high peak loads have performance requirements that can often be better handled by not using CMR. One example is a a system that accepts up to a milion messages per day where each message contain anywhere from a dozen relationships to a few hundred. Traversing relationships is not a good approach here. -
3. Re: Entity EJB associations
revitale1 Feb 16, 2002 4:13 PM (in response to revitale1)I guess local interfaces in EJB 2.0 solve the problem
Hasan -
4. Re: Entity EJB associations
dhnguyen Feb 20, 2002 6:30 PM (in response to revitale1)U dont have problem in the first place. What it means now is that you want to use CMR coupled with Container-Managed persistent. This is the easiest way to manage entity bean relationships. Well refering to the reply from JBOSSUser previously for performance consideration.