Slide 33
Slide 33 text
class Account {
public float $balance;
}
class AccountService {
public function reduceBalance(Account $account, float $amount): void {
if ($account->balance < $amount) {
throw new Exception("残高不足です");
}
$account->balance -= $amount;
}
}
ドメインをマッピングができてないと
ドメインと違うコトバ