In a DDD model, a Value Object should be immutable. Which of the following code snippets violates this principle?
Aclass Money:
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency
Bclass Money:
def __init__(self, amount, currency):
self._amount = amount
self._currency = currency
Cclass Money:
def __init__(self, amount, currency):
self._amount = amount
self._currency = currency
@property
def amount(self):
return self._amount
Dclass Money:
def __init__(self, amount, currency):
self.amount = amount
self.currency = currency
def change_amount(self, new_amount):
self.amount = new_amount