model view controller architecture of java web applications dr. m v s peri sastry,...

11
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Upload: cuthbert-johnson

Post on 05-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Model View Controller Architecture of Java Web Applications

Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Page 2: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Page 3: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Model View Controller

Page 4: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Model View Controller

Page 5: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

L 5.1

Page 6: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

• Model consists of data and the functions that operate on data

• Java bean that we use to store data is a model component

• EJB can also be used as a model component

L 5.2

Model

Page 7: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

• View is the front end that user interact.• View can be a HTML JSP Struts ActionForm

L 5.3

view

Page 8: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

• Controller component responsibilities1. Receive request from client2. Map request to specific business operation3. Determine the view to display based on the

result of the business operation

L 5.4

Controller

Page 9: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Advantages of MVC architecture

• 1) Clear separation between presentation logic and business logic.2)Each object in mvc have distinct responsibilities.3)All objects and classes are independent of each other.so change in one class does't need alternation in other classes.4)Easy to maintain the code and future improvements.

Page 10: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Disadvantages

• Increased Complexity• Time consuming• Knowledge of multiple technologies are

required• If you change controller code then• i. We need to recompile the class & redeploy

the Application• ii. We need to write separate code for that file

Page 11: Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]

Thank you