Lecture 3-System architecture 2 Flashcards

1
Q

What is the Model-View-Controller (MVC) used for?

A

Widely used for many object-oriented designs involving user interaction.

*part of the basic of the Smalltalk programming environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 3 parts of MVC?

A

-Model –> application domain
-View –> display of the application’s state
-Controller –> user interaction with the model and the view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 3 responsibilities of the Model?

A

-Manages the behaviour and data of application domain
-Responds to requests for info about its state(usually from the view)
-Responds to instructions to change state(usually from the controller)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 2 responsibilities of the View?

A

-It renders the contents of a portion of the model’s data for visualization or interaction.
-If model data changes, the view MUST update its representation as needed using:
–push model :view registers itself with the model for change notifications (observer pattern)
–pull model: view calls model when it needs to update data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the Controller do?

A

It translates the user’s interactions + view with it into actions that the model will perform.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 4 MVC interactions?

A

1.The model objects are created –> (each object is part of business model)
2.The views register as observes on the model objects–> model does not know that view or controller exist. it just sends notifications to all observers.
3.The controller is bound to a view–> (any action made by user through view will invoke a method in the controller class)
4.The controller is given a reference to the underlying model–> (when controller method is called, it triggers model’s functions/ state change)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the MVC-I?

A

It’s a simple version of MVC architecture where the system is decomposed into two sub-systems :
-Controller-View
-Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the sub-system Controller-View do(2)?

A

-It takes care of input and output processing and their interfaces
-Registers with(attaches to) the data module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the sub-system Model do?

A

It copes with all core functionality and the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the relationship between the 2 sub-systems?

A

The Controller-View is an observer of the data in the Model module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain MVC vs Layered architecture(IA) for Dependency

A

MVC –> flow control is often bidirectional
LA–> flow control is unidirectional (each layer depends on layer under)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain MVC vs Layered architecture(IA) for Responsibilities

A

MVC–> Model, View, Controller
LA–> Presentation, business logic , data access layer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain MVC vs Layered architecture(IA) for Use cases

A

MVC–> often used in web, GUI desktop and some mobile apps
LA–>large scale enterprise apps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly