MVC Patterns.pdf - MVC Pattern MVC Pattern stands for...

Doc Preview
Pages 5
Total views 33
MVC Pattern 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 are going to create a Student object acting as a model.StudentView will be a view class which can print student details on console and StudentControlleris 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.
Step 1 Create Model. Student.java public class Student { private String rollNo; private String name; public String getRollNo() { return rollNo; }
Course Hero Badge

Want to read all 5 pages?

Previewing 3 of 5 pages Upload your study docs or become a member.
Course Hero Badge

Want to read all 5 pages?

Previewing 3 of 5 pages Upload your study docs or become a member.
Course Hero Badge

End of preview

Want to read all 5 pages? Upload your study docs or become a member.