Как работает система MVC?

Я пытаюсь изучить шаблон MVC, но в каждом месте говорят что-то свое. Так что теперь я не знаю, что такое настоящий MVC.

Так что я предполагаю, что это самый чистый MVC:

Model is just data and notify data changes. View reads the messages of the Model to update the view. Controller reads the user input from View and changes the Model according.

Implementing

Model knows no one. View knows the Model. Controller knows both View and Model.

псевдокод:

/* Model */
class Color{ 
  color = blue;
  setColor(color);
  notifyUpdate();
}
/* View */
class ColorPicker(model){
  model.register(update);
  update(){
    this.colorToExhibit = model.color;
  }
}
/* Controller */
class Colorize(view, model){
  view.register(update);
  update(color){
    model.setColor(color);
  }
}

Некоторые вопросы:

Is that right? I can't see why the View cannot change the Model directly, but through Controller. Suppose I have animations to be performed after an action. Who must handle this animation: the Model, the View, or the Controller? Also: the animation logic is part of the Model, View, or Controller? More: Suppose a Poker game. After the user choose an action (say, 'Raise'), the system must play an animation (say, the chips going from player spot to the desk). How can I see this poker example (with animation) as a MVC? Can you explain and give a pseudocode about that?

Спасибо.

Ответы на вопрос(3)

Ваш ответ на вопрос