Exforsys

Free Training

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. ...

Go Back   Exforsys > Testing > Software Patterns

Exforsys.com

  #1 (permalink)  
Old 04-09-2005, 04:40 PM
Steve Green
Guest
 
Posts: n/a
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-12-2005, 04:18 AM
Manuel Collado
Guest
 
Posts: n/a
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2005, 08:56 AM
Ted Hill
Guest
 
Posts: n/a
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2005, 03:35 AM
cstb
Guest
 
Posts: n/a
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

..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2005, 04:00 PM
Steven
Guest
 
Posts: n/a
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2005, 06:30 AM
komtanoo@gmail.com
Guest
 
Posts: n/a
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-02-2005, 05:31 AM
noShit
Guest
 
Posts: n/a
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.