sphere of knowledge, influence, or activity. The subject area to which the user applies a program is the domain of the software. A description of a boundary (typically a subsystem, or the work of a particular team) within which a particular model is defined and applicable. A language structured around the domain model and used by all team members within a bounded context to connect all the activities of the team with the software. %$$
{! $productPrice = $product->getPrice();! if ($moneyPayed->getCurrency() !== $productPrice->getCurrency()) {! throw new OrderException('The Currency of that payment is invalid');! }! ! if ($moneyPayed->getPrice() !== $productPrice->getPrice()) {! throw new OrderException('You must pay me!');! }! ! $conditions = $product->getConditions();! ! foreach ($conditions as $condition) {! if (!$condition->isValid($customer)) {! throw new OrderException('You must meet the product requirements!');! }! }! ! $goods = $product->getGoods();! foreach ($goods as $good) {! $good->give($customer);! }! }!
new Order(rand(), $this, $product);! $this->recordThat(! new OrderCreated($order->getId(), $this->id, $product)! );! ! return $order;! }! We are recording Events!
throw new OrderException('The Order amount is not satisfied');! }! $this->product->deliver($this->customer);! $this->status = OrderStatus::create(OrderStatus::ORDER_PAID);! } catch (\Exception $e) {! $this->status = OrderStatus::create(OrderStatus::ORDER_FAILED);! }! return $this->status;! } &# ## Return what we need
$customerId);! ! public function findByCustomerId($customerId);! ! public function save($id, $productId, $customerId, $status = 1);! ! public function remove($id);! ! public function removeByCustomerId($customerId);! ! public function clearAll();! }! &# ## We provide an Interface