php oop actor to act on object

TheMadProfessor

New Member
Considering architecture....I normally have a shopping cart class with addItem and removeItem methods (amongst a couple of others). However in the spirit of real world shananigans carts should be acted on by customers - therefore should the addtoCart / removefromCart not be a method of the customer?OR should I have an itermediate CustomerActsOnCart object that takes the customer and cart objects as arguments in the constructor and perform the manipulation in there???Any musings would be most welcome...
 
Back
Top