jeudi 7 mars 2019

In a simple MVC Pattern, what component is responsible for originating (sending) data change events? What component receives them?

Example: Assume we have an application with two windows of some sort, open with two different presentations (views) of the same data. The first view (or both views) provides the ability to modify the underling data (model). Presumably then, when a data (model) change is made, an event is fired which triggers the second view (and even possibly the first) that its model has changed and it needs to refresh itself. My questions:

1) What component fires the data change event? I presume that the model must fire the event because it certainly knows of data change events.

2) What component is listening to the model change events? Would it be the controller or the views?

3) Or am I taking too low a perspective on this and the MVC pattern does not prescribe such an event architecture?

Aucun commentaire:

Enregistrer un commentaire