Just as some background, I do have ICartRepo and CartRepo (I've been oversimplifying everything). The model classes handles the logic (calculating prices, update quantity, delete item, emptycart, etc.) and the repo saves things when I'm done.
This is where it gets really confusing for me. IMHO the cart should know what items it has and how to get rid of them (or change their quantity, or add a new item). Then saving the cart (and its contents) should be handled by the repository. When I want the cart back, get it from the repository. The real work happens in the model, not the repo. I don't understand why we want to have the repository managing what it is in the cart. Doesn't this go against what we've been trying to accomplish (a model that lives outside its persistence)? On Oct 28, 7:01 pm, "Victor Kornov" <[EMAIL PROTECTED]> wrote: > btw, is there a reason for that other than AR/NH being incapable (or we) to > do that simpler way (i.e. just detaching it from relevan aggregate root)? > > On Wed, Oct 29, 2008 at 1:07 AM, Ken Egozi <[EMAIL PROTECTED]> wrote: > > create ICartRepository in the domain layer and ARCartRepository in the > >> persistance layer, > > > I second that. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
