Diff Between MVT & MVC
Diff Between MVT & MVC
Mvc(Model-View-Controller Pattern)
Step 2
Create View.
StudentView.java
public class StudentView {
public void printStudentDetails(String studentName, String
studentRollNo){
System.out.println("Student: ");
System.out.println("Name: " + studentName);
System.out.println("Roll No: " + studentRollNo);
}
}
Step 3
Create Controller.
StudentController.java
public class StudentController {
private Student model;
private StudentView view;
Step 4
Use the StudentController methods to demonstrate MVC
design pattern usage.
MVCPatternDemo.java
public class MVCPatternDemo {
public static void main(String[] args) {
controller.updateView();
}
Step 5
Verify the output.
Student:
Name: Robert
Roll No: 10
Student:
Name: John
Roll No: 10
Advantages of MVC Architecture
The advantages of MVC architecture are as follows:
Django MVT
(MVC) (MVT)
1. MVC has MVT has Views for receiving
controller that HTTP request and returning
drives both Model HTTP response.
and View.
2. View tells how Templates are used in MVT
the user data will for that purpose.
be presented.
3. In MVC, we have Controller part is managed by
to write all the the framework itself.
control specific
code.
4. Highly coupled Loosely coupled
5. Modifications are Modifications are easy
difficult
6. Suitable for Suitable both small & large
development of applications.
large applications
but not for small
applications.
7. Flow is clearly Flow is sometimes harder to
defined thus easy understand as compared to
to understand. MVC.
8. It doesn’t involve URL pattern mapping takes
mapping of place.
URLs.