Hi, i'm building a j2ee e-commerce application. I've modelled the system classes and the database, wich has around 20 tables (i took care of object-relational impedance mistach and everything else i could). Now, i'm in a deep doubt! Actually, my question is a mixture of j2ee concepts with mapping concepts. Anything i say from now on is a part of my doubt :-( After i modelled the system classes, i have to steps: - Modelling entities beans (with composite entity?) - Modelling session beans, wich i could choose from the system use cases About the entities,I think it would be better to use composite entity design pattern to build the entities ejbs, but how do i make the choices? I mean, how do choose wich tables are gonna be joined in one composite entity? Thanks,
Quite honestly, with EJB 2.0, I find the composite entity pattern to no longer be useful. That's not only my opinion -- check Floyd Marinescu's "EJB Design Patterns" book on chapter 9, "EJB Design Strategies" where the first strategy is "Don't use the Composite Entity pattern". Just model each table as an EJB 2.0 entity with relationships between the tables modeled as EJB relationships.
Originally posted by Kyle Brown: Quite honestly, with EJB 2.0, I find the composite entity pattern to no longer be useful.
I wholeheartedly concur. Further, one of the main benefits of entity beans is CMP. But with the Composite Entity pattern you're SOL. You can't use CMP to map to a parent-child entity like a Person with Addresses. So you're stuck with BMP at which point I wonder why you're not using Hibernate. Of course, even if you *are* using CMP, I still wonder why you're not using Hibernate. [Sorry, couldn't resist]