
- Forum
- Testing
- Software Patterns
- MVC Pattern
MVC Pattern
This is a discussion on MVC Pattern within the Software Patterns forums, part of the Testing category; I am trying to learn and apply the model-view-controller pattern. I am having a little trouble grasping it so far. ...
-
04-09-2005, 04:40 PM #1Steve Green Guest
MVC Pattern
I am trying to learn and apply the model-view-controller pattern. I am
having a little trouble grasping it so far. What I gather so far is that the
model uses the Observer pattern to notify its views. The controller updates
the model. What does the controller do to the view? Should the controller
talk to the view?
--Steve
-
04-12-2005, 04:18 AM #2Manuel Collado Guest
Re: MVC Pattern
Steve Green escribió:
> I am trying to learn and apply the model-view-controller pattern. I am
> having a little trouble grasping it so far. What I gather so far is that the
> model uses the Observer pattern to notify its views. The controller updates
> the model. What does the controller do to the view? Should the controller
> talk to the view?
MVC on Java Swing:
http://www.javadesktop.org/tsc/artic...ure/index.html
Hope it helps,
--
To reply by e-mail, please remove the extra dot
in the given address: m.collado -> mcollado
-
04-12-2005, 08:56 AM #3Ted Hill Guest
Re: MVC Pattern
There is a very good/clear explanation of MVC in the new book
Head First Design Patterns
Chapter 12: Patterns of Patterns
It shows how the following 3 patterns
1. Strategy
2. Composite
3. Observer
are combined in MVC.
It is an excellent book on design patterns and the application of OO
principles.
-
04-18-2005, 03:35 AM #4cstb Guest
Re: MVC Pattern
Steve Green wrote:
> I am trying to learn and apply the model-view-controller pattern. I am
> having a little trouble grasping it so far. What I gather so far is that the
> model uses the Observer pattern to notify its views. The controller updates
> the model. What does the controller do to the view? Should the controller
> talk to the view?
You've got the basic idea.
The controller only talks to the view if/when
the view/controller has additional state
which is not known to or a part of the model,
but *is* visibly indicated as part of the view;
e.g. current font selection {normal, bold italic}.
Or to complete an interaction with the host OS,
or perhaps telling the view to close, etc.
Regards,
-cstb
..
-
04-18-2005, 04:00 PM #5Steven Guest
Re: MVC Pattern
>There is a very good/clear explanation of MVC in the new book
>
>Head First Design Patterns
>
>Chapter 12: Patterns of Patterns
>
>It shows how the following 3 patterns
>
>1. Strategy
>2. Composite
>3. Observer
>
>are combined in MVC.
>
>It is an excellent book on design patterns and the application of OO
>principles.
Well, I went ahead an picked up a copy of this book.
Hopefully it will be of some use.
-
04-19-2005, 06:30 AM #6komtanoo@gmail.com Guest
Re: MVC Pattern
The Controller is usually implemented as states. It gets data from
Model and uses View as the way to output data. Users use the data to
make his decision and give some feedbacks through View inorder to
control the Controller(for example, change states) and the process
repeats util reaching state EXIT.
I like to see the MVC as a special kind mediator pattern. Since the
controller separates the Model and View apart. The controller also
works as state. So, the MVC is a combination of Mediator and State
patterns...!?
Steve Green wrote:
> I am trying to learn and apply the model-view-controller pattern. I
am
> having a little trouble grasping it so far. What I gather so far is
that the
> model uses the Observer pattern to notify its views. The controller
updates
> the model. What does the controller do to the view? Should the
controller
> talk to the view?
>
> --Steve
-
05-02-2005, 05:31 AM #7noShit Guest
Re: MVC Pattern
Steve Green wrote:
> I am trying to learn and apply the model-view-controller pattern. I am
> having a little trouble grasping it so far. What I gather so far is that the
> model uses the Observer pattern to notify its views. The controller updates
> the model. What does the controller do to the view? Should the controller
> talk to the view?
>
> --Steve
>
>
If you're interested in going to the source, take a look at:
http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html
and as always wikipedia is a good source:
http://en.wikipedia.org/wiki/MVC
Kim
-
Sponsored Ads

Reply With Quote





