I'm still trying to understand this whole separation of concerns and one thing I dont understand is difference between model and controller in terms of data modification.
Suppose I have a simple model:
public class BankAccount
{
private decimal amount;
public decimal Amount
{
get
{
return amount;
}
private set
{
amount = value;
}
}
public BankAccount(decimal amount)
{
Amount = amount;
}
public decimal DepositMoney(decimal amount)
{
Amount += amount;
return amount;
}
public decimal WithdrawMoney(decimal amount)
{
Amount -= amount;
return amount;
}
}
I believe this is what the model is all about. But, where do I call these methods? Is it inside a controller? Can I modify data there? For example, if I want to transfer some money from Jim to Joe; would I call this method joe.DepositMoney(jim.WithdrawMoney(25));
from the controller? Or should I create a method for transfering money in the model and call just this method?