Could someone give examples of domain models where I definitely NOT should use CMP2.0.
thanks for the link. I was looking for more detailed information such as specific domain model examples where CMP isnt a good idea. I dont know, but what about circular dependencies where it is not possible to break bi or unidirectional relations ? Would be glad for an enlightning example !
"I was looking for more detailed information such as specific domain model examples where CMP isnt a good idea."
The choice between CMP and BMP is independent of the domain.
"I dont know, but what about circular dependencies where it is not possible to break bi or unidirectional relations?"
Then you've got bigger problems than choosing your persistence scheme. If you have bi-directional references, the chance of deadlocks occuring is significant, and CMP/BMP won't help you there.
If you are absolutly sure you have a very simple entity system, and you wil never, ever (ever, ever) change appservers, then CMP is ok. In all other situations BMP is preferable, since extracting a row of data and populating some instance variables is fairly trivial, and not labor intensive. Trying to implement a correct inheritance scheme with CMP is next to impossible (depends on DB layout). Also CMP implementation is fairly app-server specific, thus porting to other platforms (which is very handy during testing) is a pain.
You are right, I would break the such a circular dependency in the model. I would have guessed that prototyping a part of the system using CMP, then choosing appserver would be a good strategy. Using BMP (even with DAOs) would make it more difficult to change the appserver/db the further down the project you are, I guess.
You seem to be very negative to CMP2.0. Maybe you have your reasons, anyway there does not seem to be a general consensus on this issue :-) Eg reading the books by Roman and Marinescu gives that impression.
I'd really like to here if it is a general thought that the choice bmp vs cmp2.0 is independent of domain model.
I'm using CMP 2.0 with JBoss 3.0 and WLS 7.0 and it works very well without changes.
With BMP you have to do anything yourself, even "dumb" code.
BMP will not be the future (it's simply the M$ VB style of coding).