(sf1.4/Doctrine)

Hi all,

Let's say I'm developing an ecommerce solution. I have the following models:

Order - takes a shopping cart all the way through to an actual order.

OrderItem - link between the Order and one or more Products

Product - a catalogue of products

Promotion - e.g., buy one get one free, or 10% off item, buy these
both for $10, etc

The part I'm interested in is the promotions. I *could* do the logic
in the Order model like so:

$order = new Order();
...
$order->applyPromotion($promotion);

But there is likely to be quite a lot of logic, depending on what kind
of promotion it is (adding OrderItems, discounting Orders, etc), so my
instinct was to create a PromotionManager class so for example:

$promoManager = new PromotionManager();
$promoManager->appyPromotion($promotion, $order);

Is this a better way to go, or am I causing myself needless abstraction?

I know there's more than one way to skin a cat, but I'm trying hard to
get to grips with the best way.

Anyway, thanks in advance.

Tom

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to