0% found this document useful (0 votes)
14 views4 pages

Unit - 4: Pattums

Paper about Model View comtroller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Unit - 4: Pattums

Paper about Model View comtroller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

clAssMat

Date
Page
Unit -4
Q1. MVC

Qontrolle acts as the inturmadiany betwen the


applicahon's viw objects and its model objects

Controllers are often in oharge of making SUe that


Vius haveacces to the model objects they nedto
dlisplay
Contollus act os a condwit through which vi lws
Jearn abput the ohanges to the mo clel.

Modal- Viw- lontrollr (Mvc) is a design patturn that


composed of Several more basic olesign.
potterns.

MvC is made up of Composife, Strategy and


Observer
pattums.
Composite The iuw objects in on appli cation art
actually Com posite. of nested vius
that Dork toqether ina coorolinated mann
(ie. the viw hivarchy)
These display comonunts range from.
window, to comp 0Und views such a
a table, to individual viuwS Such OUs
buttons

Strategy controlle object implemunts the stratgy


for one or more viw objects
The viuw objeot oonfine itself to
hnointaininq the visual aupects andl
nd it
delegates all olecis iong to the controllen
dassute
Defe
Page

Obsurve molel objech kaaps intursted objects in


an applicaion (usually viw obyj'ects) inprmid
Of changu in it's state.

controlle object recieves the event and applies a


Strategy
This strategy can be to nequest a moolel object to
hangeit's state or to qvest a view object to
Change it's buhavio ur or appearanc.
The model object in urn notifu al objects registerrd
obsenus when H's state ahangei.
f the obseve is a viw object,it may update it's
appaarance accoralingly

Strategy
Contoller
rUser achion
-Updlate

Viw Up dlate - Model


Composite
-Nohfy 0bsever

-Get changed state


MVC

Detign
Patterns
Page

The vser nuds to inteact with an opp intufac in


the simplest way possi ble.

Snturface must
andl make it
be cleigned with dhe userin mind,
effcient . clear and straig hifonu crd

As appli cati ons bacome more complex, wewill oreate


intorfaces wih more scenes and more Viws

moolel Conholler

Viw

MvC rchitecture

mo del contoller iS one that Concuns itself mostly


with the moclel ay

SHs primary rsponiibility isto manage the mocal and


communicate with the viuw objects
Aetion metho d applied to the modl au a whole
are typically implemunted in the madal Controller

e9. NS Do cumenlCentrollu object awtomahcally


handlu acion metho dA related to saving tile
Date
Page

viw controller iS con troller that Concerns tsele


mostly with he viw louyer

St's primary respansibility is to manage the inteface


and communicate wih the moolel objects.

otion methods Aptemot concemud with the data


olisplayed in the viuw are typically implementdin
a view controllr.

cq. NSWindowCon holle object is example of viw


Cantroller.

A coorolinatinq cantroller is typically an NSWindowController


Or NS Documentlonholly or Qn jnstance Custom
Subdaas of Nsobject.
It's ole is to oversee or coorolinate the fonctioning
of the entire application Or
part of an applicati on.

The coorolinating Contolle provid seicel such u

kesponding to dalgation musagu and observeing


notif cations
Rupondling to ction messages

TManaging the ifetime of ouwned objects lcg eleasing men


at propr time)

Establis hinq connechions betuen objats and pefoming


other sct- vp touks.

You might also like