mvc design mode

this is my first time meet the MVC in the project.before then,i have leran the design mode.even so,i has not learn the soul of the design mode.perhaps,i don’t know the interface.this time,i not only understand the MVC, but also know what is the interface,and how to use the interface.because this blog is about the design mode,i will not say the interface.but i will write it in another blog. first,when we write the logic code about project’s UI.we will write something about the view and change the display of view.if we want to change it,should get the data.so we do three things:

1. display view.
2. get data.
3. change the display of view.

View

now real charactor appearances, i can write a class about view who responsibles for two things:

1. display the view.
2. given the interface about how to change the view.

so we get the two: View.cs,IView.cs (Ps:i will use the c sharp to description.)

Model

then,i can write the second class about model who responsibles for three things:

1. change the data.
2. get the data.
3. given the interface bout how to get and change the model.

in there,i can add a observer to monitor the change of model.when the data in model is changed,he will send a event message,if somewhere accept the message,then can call the function who was registed.so we get two too: Model.cs,IModel.cs

Controller

and there is a controller need to be done.the controller responses three things:

1. add view event.
2. change model.
3. change the display by model.

so we get one: Controller.cs

We’d better have a manager to controller the panel’s jump,the one who manage all panels, or manage a system of all panels.