Slide 50
Slide 50 text
// Using product as a base
$product = new Product(new BlackFriday(), 6.00, 'Pizza');
$product->getPrice(); // 3.99
$product = new Product(new ValentinesDay(), 6.00, 'Pizza');
$product->getPrice(); // 5.75
// Using individual products (abstractions)
$product = new ChickenWings(new BlackFriday(), 12.50, 'Wings');
$product->getPriceWithSauce(); // 8.64
$product->getPriceWithoutSauce(); // 7.99
$product = new ChickenWings(new ValentinesDay(), 12.50, 'Wings');
$product->getPriceWithSauce(); // 12.90
$product->getPriceWithoutSauce(); // 12.25