OO design for business logic

Posted by hotyi on Stack Overflow See other posts from Stack Overflow or by hotyi
Published on 2010-04-30T05:17:33Z Indexed on 2010/04/30 5:27 UTC
Read the original article Hit count: 321

Filed under:

I have one Sell Operation object and two Buy Operation objects, i want to implement such behavior that one Sell Operation discharges two Buy Operation, it looks like:

sellOperation.Discharge(oneBuyOperation);
sellOperation.Discharge(twoBuyOperation);


so i want to ask whether i should call the repository function in the Discharge method, or i'd better call the repository save method outside Discharge method. like:

opRepository.Save(sellOpertion);

So anyone could give me some advise what are you going to implement in this scenario? using Service class or anything better way?

© Stack Overflow or respective owner

Related posts about c#