There is a lot of confusion compared to MVC, but after you scroll through the book “Head First patterns” (as a side note, I hate this brand, although this example was not bad), it claims that MVC or Model View Controller is a hybrid several patterns - intermediary, observer, etc.
In a recent prototype, I did the following, it is C #, but should be simple.
Person : IPerson {
public Name { get; set;}
public Age { get; set;}
}
IPerson is just an interface defining the above - I left it for simplicity.
PersonController : IPersonController {
public event DetailsUpdated;
public void SetAge(int age);
public int GetAge();
public void SetName(string name);
public string GetName();
}
I know that the foregoing may be property - but this is just a simple example. An event is fired every time some data changes - for example, in SetAge / SetName.
interface IView {
void Initialize();
void SetAgeClicked(object sender, EventArgs e);
void SetNameClicked(object sender, EventArgs e);
}
- . . SetAge/SetName - , / .. .
Form : IView {
// IView is implemented.
// Form is wired up
// Initialize is set etc...
}
, MVC - , - - , . , MVC? - ?
/ . - , .
.