0% found this document useful (0 votes)
26 views

Model-View-Controller (MVC) : Architectural Pattern Software Engineering Business Logic User Interface

The document discusses the Model-View-Controller (MVC) framework methodology. It defines the three components - models, views, and controllers. Models are responsible for maintaining application state, typically from a database. Views are responsible for displaying the user interface based on model data. Controllers are responsible for handling user input, updating models, and choosing views to render. The benefits of MVC include separation of concerns, testability, flexibility in user interfaces, and ability for simultaneous development without conflicts.

Uploaded by

Ek Rah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Model-View-Controller (MVC) : Architectural Pattern Software Engineering Business Logic User Interface

The document discusses the Model-View-Controller (MVC) framework methodology. It defines the three components - models, views, and controllers. Models are responsible for maintaining application state, typically from a database. Views are responsible for displaying the user interface based on model data. Controllers are responsible for handling user input, updating models, and choosing views to render. The benefits of MVC include separation of concerns, testability, flexibility in user interfaces, and ability for simultaneous development without conflicts.

Uploaded by

Ek Rah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment # 01

PHP

ModelViewController (MVC)
ModelViewController (MVC)
is
an architectural
pattern used
in software engineering. Successful use of the pattern isolates business
logic from user interface considerations, resulting in an application where
it is easier to modify either the visual appearance of the application or the
underlying business rules without affecting the other. In MVC,
the model represents the information (the data) of the application;
the view corresponds to elements of the user interface such as text,
checkbox items, and so forth; and
the controller manages the communication of data and the business rules
used to manipulate the data to and from the model.

MVC Framework
MVC is a framework methodology that divides an applications
implementation into three component roles: models, views, and controllers.

Models in a MVC based application are the components of the


application that are responsible for maintaining state. Often this state is
persisted inside a database (for example: we might have a Product class
that is used to represent order data from the Products table inside SQL).

Views in a MVC based application are the components responsible for


displaying the applications user interface. Typically this UI is created off
of the model data (for example: we might create an Product Edit view
that surfaces textboxes, dropdowns and checkboxes based on the current
state of a Product object).

Controllers in a MVC based application are the components


responsible for handling end user interaction, manipulating the model, and
ultimately choosing a view to render to display UI. In a MVC application
the view is only about displaying information it is the controller that
handles and responds to user input and interaction.

One of the benefits of using a MVC methodology is that it helps enforce a


clean separation of concerns between the models, views and controllers
within an application. Maintaining a clean separation of concerns makes the
testing of applications much easier, since the contract between different
application components are more clearly defined and articulated.

Assignment # 01

PHP

MVC
Model responsibilities

Store data in properties


Implement application methods (e.g., clockmodel.settime() or
clockmodel.stop())
Provide methods to register/unregister views
Notify views of state changes
Implement application logic (e.g., the clock ticking)
View responsibilities
Create interface
Update interface when model changes
Forward input to controller
Controller responsibilities
Translate user input into changes in the model
If change is purely cosmetic, update view

Benefits

Clear separation of concerns

Testability support for Test-Driven Development

Intuitive URLs

allows multiple representations (views) of the same information


(model)
allows user interfaces (views) to be easily added, removed, or changed
allows response to user input (controller) to be easily changed
changes can happen dynamically at runtime
2

Assignment # 01

PHP

promotes code reuse (e.g., one view might be used with different
models)
allows multiple developers to simultaneously update the interface,
logic, or input of an application without affecting other source code
helps developers focus on a single aspect of the application at a time

You might also like