Introduction To MVC Pattern: Model-View-Controller (MVC) Is A Software Architecture or An Architectural Pattern
Introduction To MVC Pattern: Model-View-Controller (MVC) Is A Software Architecture or An Architectural Pattern
Introduction To MVC Pattern: Model-View-Controller (MVC) Is A Software Architecture or An Architectural Pattern
MODEL:
The model manages the behavior and data of the application domain, responds to
requests for information about its state and responds to instructions to change state.
VIEW:
The view renders the model into a form suitable for interaction, typically a user
interface element.
CONTROLLER:
The controller receives input and initiates a response by making calls on
CONTROL FLOW IN MVC:
The user interacts with the user interface in some way.(say a key press)
The controller handles the input event from the user interface, via a handler or
callbackand converts the event into appropriate user action, understandable for
the model.
The controller notifies the model of the user action, possibly resulting in a
change in
the model's state.
The view gets its own data from the model or the controller may issue a
general instruction to the view to render itself.
The user interface waits for further user interactions, which restarts the cycle.
What is Spring?
● Lightweight in terms of both size and overhead where changes can be made easily.
●
Dependency Injection
When DI is applied, objects are passively given their dependencies instead of creating or
looking for dependent objects themselves.
Aspect-oriented
Spring comes with rich support for aspect-oriented programming(AOP) that enables
cohesive development by separating application business logic from system
services.
Container
Spring is a container in the sense that it contains and manages
the lifecycle and configuration of application objects.
In Spring, you can declare how each of your application objects should be created,
how they should be configured, and how they should be associated with each other.
Framework
Spring makes it possible to configure and compose complex
applications from simpler components.
Spring provides rich support for aspect-oriented programming in its AOP module.
This module serves as the basis for developing your own aspects for your Spring
enabled application.
With AOP, however, application wide concerns (such as transactions and security)
are decoupled from the objects to which they are applied.
Spring’s ORM support builds on the DAO support, providing a convenient way to build
DAOs for several ORM solutions.
Spring’s web module provides special support classes for Spring MVC and Spring Portlet
MVC.
The web module also contains support for several web-oriented tasks, such as
multipart file uploads and programmatic binding of request parameters to your
business objects.
Spring’s JDBC and Data Access Objects (DAO) module abstracts away the boilerplate
code so that you can keep your database code clean and simple.
This module also builds a layer of meaningful exceptions on top of the error messages
given by several database servers.
The core module’s BeanFactory makes Spring a container, but the context module is what
makes it a framework.
This module extends the concept of BeanFactory, adding support for internationalization
(I18N) messages, application lifecycle events, and validation.
In addition, this module supplies many enterprise services such as email, JNDI
access, scheduling etc.
Spring comes with its own very capable MVC framework that promotes it’s loosely
coupled techniques in the web layer of an application.
This module contains the BeanFactory, which is the fundamental Spring container
and the basis on which Spring’s Dependency Injection(DI) is based.