Experiment 10
Experiment 10
Experiment No. 10
A cursory glance at the code will tell us that this controller class is just responsible for calling the
model to get/set the data and updating the view based on that. Now let’s have a look at how all of
these are tied together.
The above class fetches the course data from the function using which user enters the set of
values. It then pushes those values into the Course model. Then, it initializes the view we had
created earlier in the article. Further, it also invokes the CourseController class and binds it to
the Course class and the CourseView class. The updateView() method which is a part of the
controller then updates the course details on the console. Check out the output below.
Output
Course Details:
Name: Java
Course ID: 01
Course Category: Programming
After updating, Course Details are as
follows
Course Details:
Name: Python
Course ID: 01
Course Category: Programming
Q 1 - In MVC pattern, View represents the visualization of the data that model contains.
A - false
B - true
Q 2 - Which of the following pattern is used to separate application's concerns?
A - Visitor Pattern
B - MVC Pattern
C - Business Delegate Pattern
D - Composite Entity Pattern
3. What does MVC pattern stands for?
a) Mock View Control
b) Model view Controller
c) Mock View Class
d) Model View Class
4. Which design pattern works on data and action taken based on data provided?
a) Command pattern
b) Singleton pattern
c) MVC pattern
d) Facade pattern
5. In the model-view-controller (MVC) architecture, the model defines the
1. Data-access layer
2. Presentation layer
3. Business-logic layer
4. Interface layer