Joe Parks
Posts: 107
Nickname: joeparks
Registered: Aug, 2003
|
|
Re: Modelling a Many-to-Many Relationship
|
Posted: Oct 15, 2003 3:51 AM
|
|
As I understand it, the two objects are closely coupled--they contain collections of each other.
As far as Ambler's article is concerned, I think that this only goes half way. I would agree that this is the appropriate object model for the solution, but how is the state of the objects persisted? I think that was (at least partly) the original question: How do you map a many-many relationship between a database and an object model?
Depending on the deployment environment, I don't think that the sheer number of objects introduced by a useful library (including JDBC) should be an obstacle, as long as there is a clear separation of concerns. That is, for example, don't let database tables simply translate one-one into objects. And don't put persistence-related code directly in business objects. Or presentation-related code, for that matter.
Now, if you want to spend project time rolling your own application-specific data access code with straight JDBC, that's up to you.
I would suggest, though, that this (specific) argument is moot, because the Ownership object almost certainly contains its own data and behavior; it is not a true many-many relationship.
|
|