Partially hydrated entity for listing - Application or Domain Concern
Subject: Partially hydrated entity for listing - Application or Domain Concern
Newsgroups: gmane.comp.programming.domain-driven-design
Date: 2008-08-06 21:24:24 GMT
Is wanting a partially hydrated entity or collection of entities a application concern or a Domain concern?
For example in the context of an e-commerce site I will have a product entity which could have a collection of user review entites, detailed picture entities etc. Now I will need all of this information when displaying a product on a product detail page. However when I am listing all products in a category I will not need all the user reviews and picture details information.
I was thinking of putting this concern into the application layer like so:
' Application Layer
Public Shared Function getProduct(ByVal ID As Long) As Model.Product
Dim aProduct As ProductCatalogService
aProduct = _ProductRepository.FindByID(ID)
aProduct.Reviews = _ProductRepository.GetProductReviews(ID)
aProduct.DetailedPictures = _ProductRepository.GetProductPictures(ID)
Return aProduct
End Function
Public Shared Function getProductsForListing(ByVal Category As String) As List(Of Model.Product) Dim products As List(Of Model.Product)
products = _ProductRepository.FindByCategory(Category)
Return productsEnd Function
Could this class as a Domain concern and these application layer services be moved into the Domain? If I was talking to the domain expert he may say that he wants to view a list of products but he will only want to update/add/remove a single product, so fully hydrating a list of products would not be necessary.
Thanks
Scott (still learning)
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