0% found this document useful (0 votes)
5 views16 pages

Presentation 1

The document describes the Model 1 and Model 2 (MVC) architectures in Spring MVC. Model 1 has decentralized navigation control and is harder to maintain and extend, while Model 2 centralizes navigation, making it easier to maintain, extend, and test. The MVC pattern separates concerns into Model, View, and Controller, facilitating better organization and management of application data and logic.

Uploaded by

viveksingh817298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views16 pages

Presentation 1

The document describes the Model 1 and Model 2 (MVC) architectures in Spring MVC. Model 1 has decentralized navigation control and is harder to maintain and extend, while Model 2 centralizes navigation, making it easier to maintain, extend, and test. The MVC pattern separates concerns into Model, View, and Controller, facilitating better organization and management of application data and logic.

Uploaded by

viveksingh817298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

SPRING MVC

model1 architecture
1.) Browser sends request for the JSP page
2.) JSP accesses Java Bean and invokes business logic
3.) Java Bean connects to the database and get/save data 4.) Response is sent to the
browser which is generated by JSP

Disadvantage of Model 1 Architecture


1.Navigation control is decentralized since every page contains the logic to determine the
next page. If JSP page name is changed that is referred by other pages, we need to change it
in all the pages that leads to the maintenance problem.
2.Time consuming You need to spend more time to develop custom tags in JSP. So that we
don't need to use scriptlet tag.
3.Hard to extend It is better for small applications but not for large applications.
Advantage of Model 2 (MVC) Architecture

Navigation control is centralized Now only controller contains the logic to determine the next
page.
Easy to maintain
Easy to extend
Easy to test Better separation of concerns
MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate
application's concerns.

Model - Model represents an object or JAVA POJO carrying data. It can also have logic to update
controller if its data changes.

View - View represents the visualization of the data that model contains.
Controller - Controller acts on both Model and view. It controls the data flow into model object
and updates the view whenever data changes. It keeps View and Model separate.

Implementation
We're going to create a Student object acting as a model. StudentView will be a view class which
can print student details on console and StudentController is the controller class responsible to
store data in Student object and update view StudentView accordingly.

MVCPatternDemo, our demo class will use StudentController to demonstrate use of MVC
pattern.

You might also like