MVC - cs2340:ModelViewController Fall 2008 ModelViewController 1 THE standard Smalltalk Architecture Mo d e l:Info rm a tio nfo rth e a p p lic a

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Model View Controller 1 cs2340: Model-View-Controller Fall 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Model View Controller 2 THE standard Smalltalk Architecture Mo de l: Info rm a tio n fo r the   a pplic a tio n. Vie w: Vis ua l  Re pre s e nta tio n o f the   Info rm a tio n. C o ntro lle r: Me c ha nis m  to   a llo w us e r to  c ha ng e   info rm a tio n o r vie w.
Background image of page 2
Model View Controller 3 Passive MVC Model is unaware of view/controller Simple text editor, user keys each letter, so controller notifies model and view of letter typed, everything in sync. But what if we want to reformat or load a document from disk?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Model View Controller 4 Active MVC Model has to actively notify the view that it has changed. In our text editor, we load a new file, so the model needs to tell the view that the text has changed. changed: message allows notification update: message allows reaction
Background image of page 4
Model View Controller 5 Coupling Model -> View loose coupling through dependents collection (class Model) View <-> Control Tight coupling through direct reference View -> Model Tight coupling through direct reference Controller -> Model Tight coupling through direct reference Model -> Controller No reference at all
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Model View Controller 6 Sample Bob Name: OK The VM detects a mouse click and sends it to the current Controller. The Controller has a method redButtonPressed. Assume we implement it to send ‘view okButtonPress’. The view sends ‘model name: newName’. The model can then update the name and send the ‘self changed: #name’ message. Why? Class Employee name
Background image of page 6
Model View Controller 7 Dependent update: anAspectSymbol a nAs pe c tS ym b o l = #na m e ifTrue :[ s e lf inva lida te . ]
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Model View Controller 8 Drawbacks of Traditional MVC Model has to manage all information, windows and views Model has to broadcast update: to everyone, even if only 1 object cares. View often has to know about model’s internals to respond to update: correctly. Opening the interface requires a lot of redundant, cumbersome, non-OO code.
Background image of page 8
9 More Drawbacks The model contains information germane to the problem domain AND the interface. Everyone interested in an aspect must
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/19/2009 for the course CS 2340 taught by Professor Staff during the Fall '08 term at Georgia Institute of Technology.

Page1 / 33

MVC - cs2340:ModelViewController Fall 2008 ModelViewController 1 THE standard Smalltalk Architecture Mo d e l:Info rm a tio nfo rth e a p p lic a

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online