Unit 6 MVC
Unit 6 MVC
Unit 6 MVC
► Advantages of frameworks
► Assists in establishing better programming practices and fitting use of design patterns
► Code is more secure
► Duplicate and redundant code can be avoided
► Helps consistent developing code with fewer bugs
► Makes it easier to work on sophisticated technologies
► Several code segments and functionalities are pre-built and pre-tested. This makes
applications more reliable
Overview of Frameworks
► Types of Frameworks
► Web apps
These frameworks are used specifically in the creation of online projects, whether it’s the
web design of a page or more specific web services.
► Apps
These frameworks allow to complement the structure of an application for an operating
system. A clear example is Microsoft, which has developed the .NET Framework to help
programmers reuse structures already made and which is installed in Windows.
► AJAX
AJAX technology enables the user to make requests to the server without having to reload a
page after each new request.
► Content management
Also known as CMF (Content Manager Framework), content management frameworks
facilitate the programming of CMS (Content Management System) applications such
as WordPress, Joomla, among others.
► Multimedia elements
This interface facilitates the work of developers working with video, audio and image and
helps in the creation of multimedia applications in general, as it serves for more complex
projects, such as video conferences or media converters.
MVC-Model-View-Controller
► Each of these components are built to handle specific development aspects of an application.
MVC is one of the most frequently used industry-standard web development framework to
create scalable and extensible projects.
► Features of MVC
► Easy and frictionless testability. Highly testable, extensible and pluggable framework
► To design a web application architecture using the MVC pattern, it offers full control over your
HTML as well as your URLs
► Leverage existing features provided by ASP.NET, JSP, Django, etc.
► Clear separation of logic: Model, View, Controller. Separation of application tasks viz.
business logic, Ul logic, and input logic
MVC Architecture
► Model: It includes all the data and its related logic
► View: Present data to the user or handles user interaction
► Controller: An interface between Model and View components
MVC-Model
► 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 resents the output presentation to the user.
► The view also represents the data from charts, diagrams, and tables. For example, any
customer view will include all the UI components like text boxes, drop downs, etc.
MVC-Controller
► The Controller is that part of the application that handles the user interaction. The
controller interprets the mouse and keyboard inputs from the user, informing model and
the view to change as appropriate.
► A Controller send’s 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).
MVC
► Advantages:
► Easy code maintenance which is easy to extend and grow
► MVC Model component can be tested separately from the user
► Easier support for new types of clients
► Development of the various components can be performed parallelly.
► It helps you to avoid complexity by dividing an application into the three units. Model, view, and
controller
► It only uses a Front Controller pattern which process web application requests through a single
controller.
► Offers the best support for test-driven development
► It works well for Web apps which are supported by large teams of web designers and developers.
► Search Engine Optimization (SEO) Friendly.
► All classes and objects are independent of each other so that you can test them separately.
► MVC design pattern allows logical grouping of related actions on a controller together.
Questions: