0% found this document useful (0 votes)
43 views12 pages

Worksheet 2.5 MVC Architecture

The document discusses the Model-View-Controller (MVC) architectural pattern. It defines the key components of MVC - Model, View and Controller. It provides examples to explain each component and their relationships. It also outlines some advantages and disadvantages of using the MVC framework.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views12 pages

Worksheet 2.5 MVC Architecture

The document discusses the Model-View-Controller (MVC) architectural pattern. It defines the key components of MVC - Model, View and Controller. It provides examples to explain each component and their relationships. It also outlines some advantages and disadvantages of using the MVC framework.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

ACÁ VA EL NOMBRE DEL DOCUMENTO

Acá puede ir una descripción breve o información adicional


sobre el documento.
MVC architecture
Worksheet 2.1

Vocabulary

handle
manage
pattern
output
inputs
retrieve
render
request
maintaining
Worksheet 2.2
Complete the vocabulary crossword, using the meaning information.

6.

1.

7.

2.

4.

5
ACROSS

1. Is a repeatable solution to a software engineering problem


2. The process of searching for, locating, and returning data
3. A computer system that is essential for the performance and lifespan of a computer
4. The state of being asked for or wanted
5. Any information or data sent to a computer for processing.

DOWN

6. Is an abstract reference to a resource that is used when application software


3 Is the process of managing, monitoring and optimizing a computer system for
performance
7. Refers to the act of drawing the modelled objects on screen
8. Data generated by a computer
Worksheet 2.3

Do this activity in groups:


First start reading the text, and after that you paraphrase the main ideas of each of the
following sections:

• What is MVC Framework?


• View
• Controller
• Model
• Advantages of MVC: Key Benefits
• Disadvantages of using MVC

MVC Framework

What is MVC Framework?


The Model-View-Controller (MVC) framework is an architectural pattern that separates an
application into three principal components Model, View, and Controller. Each
architecture component manages specific development aspect of an application.

Three important MVC the components are:

● Model: It includes all the data and its related logic.


● View: It presents data to the user or handles user interaction.
● Controller: An interface between Model and View components.
View

A View is that part of the application that represents the presentation of data. Views are
created by the data collected from the model data. A View requests the Model to give
information so that it presents the output presentation to the user.

Controller
The Controller is that part of the application that manages the user interaction. The
Controller interprets the mouse and keyboard inputs from the user, informing Model and
View to change as appropriate. A Controller sends commands to the model to update its
state (E.g., Saving a specific document). The Controller also sends commands to its
associated View to change the View's presentation (For example, scrolling a particular
document).

Model

The Model component stores data and its related logic. For example, a Controller object
will retrieve the customer info from the database. It manipulates data and sends back to
the database or uses it to render the same data. It responds to the request from the View
and also responds to instructions from the Controller to update itself. It is also the lowest
level of the pattern which is responsible for maintaining data.

In the diagram below, you can see the visual representation of the MVC architecture.

MVC Architecture Diagram

MVC Example
Let's see a Model View Controller example from daily life:

Let's imagine you go to a restaurant. You go there, sit at the table and wait for the waiter to come.
The waiter comes to you, and you order the food. The waiter doesn't know who you are and he
just writes down the details of your food order. Then, the waiter goes to the kitchen. In the
kitchen, the waiter does not prepare your food - the cook prepares your food. The waiter gives
your order to the cook along with your table number. The cook then prepares food for you. He
uses ingredients to cooks the food. Let's imagine that you ordered a vegetable sandwich. Then he
needs bread, tomato, potato, capsicum, onion, bit, cheese, etc. which he takes from the
refrigerator. Finally, the cook hands over the food to the waiter. Now it is the job of the waiter to
take this food outside the kitchen and serve it to you.

In this MVC example,


● View= Client
● Waiter= Controller
● Cook= Model
● Refrigerator= Data

Advantages of MVC: Key Benefits

What are the major benefits of using MVC architecture? First of all, it has a code maintenance that
is easy to extend and grow. Second, MVC Model component can be tested separately from the
user and it offers the best support for test-driven development. In addition to that, all classes and
objects are independent from each other so you can test them separately. Third, it helps you to
avoid complexity by dividing an application into the three units: model, view, and controller. It also
works well for Web apps which are supported by large teams of web designers and developers.

Disadvantages of using MVC

However, there are some disadvantages in MVC model. First, it is difficult to read, change, to unit
test, and reuse this model. Second, there is a need for multiple programmers to conduct parallel
programming. Third, the developers need to have good knowledge of multiple technologies.
Finally, the programmers need to maintain many codes in Controller.

Worksheet 2.
Wrap –Up

After you complete the previous activity, work with your group again, now you can start
ranks your partners´ paraphrased idea, and give them a score

Worksheet 2.5
Ask yourself the following questions

1. Entiendo qué es MVC architecture.


Si No Tal vez

2. Entiendo de qué componentes consiste MVC.


Si No Tal vez

3. Entiendo las ventajas y desventajas de MVC.


Si No Tal vez

4. Entiendo en qué consiste la estrategia de Paraphrasing.


Si No Tal vez

5. La estrategia de Paraphrasing me ayuda a entender mejor un texto.


Si No Tal vez

You might also like