721 reputation
826
bio website
location London, United Kingdom
age
visits member for 2 years
seen 2 days ago

Dec
15
awarded  Booster
Dec
14
awarded  Announcer
Dec
12
awarded  Yearling
Dec
12
awarded  Popular Question
Sep
22
accepted Domain model associations that do not required the behaviour of the associated object. How to model?
Sep
9
revised How to design RESTful Web Api to represent Resources
added 206 characters in body
Sep
9
comment How to design RESTful Web Api to represent Resources
updated answer above
Sep
9
revised How to design RESTful Web Api to represent Resources
added 158 characters in body
Sep
9
answered How to design RESTful Web Api to represent Resources
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
Ah ok, understood. The reason is that its needed for object retrieval (get all customers of supplier) and for object destruction (if supplier is deleted, all its customers are deleted) –
Sep
8
revised Domain model associations that do not required the behaviour of the associated object. How to model?
deleted 305 characters in body; edited title
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
Thanks for the comment. As i mentioned, neither object needs to use the other object. There is no behaviour of customer which supplier needs and no behaviour of supplier that customer needs. This is why I don't think either object should manage the association
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
Its not a problem domain question. The problem domain requires the association. The implementation of this domain (i.e. in OO) is where my question lies. How do we implement this association?
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
Why would either object be responsible for the association if they don't need the underlying object? I just feel that the supplier and customer class aren't responsible for the association, but something else in the domain model must be. What is it?
Sep
8
revised Domain model associations that do not required the behaviour of the associated object. How to model?
added 226 characters in body
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
But why would the invoice object need to know about either? My point still stands. The order object does not need to use the supplier or customer object. It has absolutely no use for any method that resides on the supplier or customer object. Why would we then bother to add the responsibility of association to the invoice object? Its useless to the object. The association isn't useless though, I just feel something else should be responsible for it.
Sep
8
revised Domain model associations that do not required the behaviour of the associated object. How to model?
added 33 characters in body
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
How is it managed in the domain? To me it seems like neither the customer or the supplier object need to know about the existence of the other. I feel there is another object which manages the association. Im wondering of its the repository from Erica Evans DDD book? Or is it something else?
Sep
8
revised Domain model associations that do not required the behaviour of the associated object. How to model?
added 185 characters in body
Sep
8
comment Domain model associations that do not required the behaviour of the associated object. How to model?
putting get methods on the supplier class will likely cause OCP problems. What if I want to at a later date have a 'partners' class. I now need to add getPartners to suppliers. This violates OCP. Putting getUser on customer class - what does this give me? The only reason I can see to have the association is for object retrieval criteria and object destruction.