Download as odp, pdf, or txt
Download as odp, pdf, or txt
You are on page 1of 8

INTRODUCTION TO MVC PATTERN

Model–View–Controller (MVC) is a software architecture or an architectural pattern


that isolates domain logic from the user interface, permitting independent development
testing and maintenance.

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.

A view queries the model in order to generate an appropriate user interface.

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?

● Spring is a lightweight framework for building java applications.


● Lightweight in terms of both size and overhead where changes can be made easily.

● Spring framework is independent of application.


● It is an Aspect Oriented container and framework.


● Terms used in Spring:

Dependency Injection

Spring promotes loose coupling through a technique known as dependency injection(DI).

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.

Application objects do what they’re supposed to do—perform business logic—and


nothing more.

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.

In Spring, application objects are composed declaratively, typically in an XML file.

Spring also provides much infrastructure functionality (transaction management,


persistence framework integration, etc.), leaving the development of application
logic to you.
SPRING FRAMEWORK
Spring’s AOP module

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.

Like DI, AOP supports loose coupling of application objects.

With AOP, however, application wide concerns (such as transactions and security)
are decoupled from the objects to which they are applied.

Object-relational mapping (ORM) integration module

Spring’s ORM support builds on the DAO support, providing a convenient way to build
DAOs for several ORM solutions.

Spring’s transaction management supports each of these ORM frameworks as well as


JDBC.
Spring’s web module

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 DAO module

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.

Spring context module

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.

The Spring MVC framework

The Model/View/Controller (MVC) paradigm is a commonly accepted approach


to build web applications.

Spring comes with its own very capable MVC framework that promotes it’s loosely
coupled techniques in the web layer of an application.

Spring core container

Spring’s core container provides the fundamental functionality of the Spring


Framework.

This module contains the BeanFactory, which is the fundamental Spring container
and the basis on which Spring’s Dependency Injection(DI) is based.

You might also like