I think the penny has finally dropped ...
Subject: I think the penny has finally dropped ...
Newsgroups: gmane.comp.programming.domain-driven-design
Date: 2008-08-05 13:30:56 GMT
I am modelling an E-commerce store and I have a product (entity) which contains a brand (entity) association and category (entity) association. Now my web site which will use the Domain Model does not need to Add/Update/Remove products, brands or categories it only needs to display them. I believe I have modelled the domain correctly by creating the product, category and brand as entities - even though in this instance I won't be using this behaviour. They are also their own aggregate roots because you don't need to go through a Product to add/remove/update a brand or category, similarly with add/remove/update of a product.
I guess this means that in the future if I need to write say a windows
application that gives staff the ability to update/add/remove a category/brand/product I can reuse the domain model.
Because for the purposes of this web application I will not be using the add/remove/update methods on the repositories for the above entities so I have just added stub code that will throw "The method or operation is not implemented" error if someone tries to persist an object. I can then at a later date code this logic if needed. - is this good practice?
This means my Model will be a true representation of the real domain and can be reused for any purpose, is this what the essence of DDD is? Model the problem domain and then start on the application?
Cheers
Scott
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
RSS Feed