21. What is
Inversion of control
Service Locator
Dependency Injection Container
http://www.martinfowler.com/articles/injection.html
http://fabien.potencier.org/article/11/what-is-dependency-injection
42. Value Object
<?php
namespace MegaCorpCore;
class ProductId
{
private $value;
public function __construct($value)
{
$this->value = (string) $value;
}
public function getValue()
{
return $this->value;
}
}
44. Value Object DateRange
<?php
public function findByDateRange(
DateTime $from, DateTime $to )
class DateRange
{
private $from;
private $to;
public function __construct(DateTime $from, DateTime $to)
{
$this->from = $from;
$this->to = $to;
}
}
public function findByDateRange(DateRange $range)