Scott Millett | 6 Aug 23:22

Partially hydrated entity for listing - Application or Domain Concern

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

' Application Layer
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 products
End 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)

__._,_.___

Your email settings: Individual Email|Traditional
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

__,_._,___

Gmane