In yschool-mini week-1 assignment, I did my first simple maven project. From that assignment I have get a little experience in maven.
This week (week 2) I have done assignment-2. This assignment is concern with MVC(Model,View,Controller) architecture.
Model
It handles data processing and database works part. Model processes events sent by controller. After processing these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.
It handles data processing and database works part. Model processes events sent by controller. After processing these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.
View
View prepares an interface to show to the user. Controller or model tells view what to show to the user. Also view handles requests from user and informs controller.
View prepares an interface to show to the user. Controller or model tells view what to show to the user. Also view handles requests from user and informs controller.
Controller
Let’s say controller is like brain of the system. That is right. Because it processes every request, prepares other parts of the system like model and view. Then the system determines what to do by controller’s commands.
Let’s say controller is like brain of the system. That is right. Because it processes every request, prepares other parts of the system like model and view. Then the system determines what to do by controller’s commands.
To understand the MVC architecture the YIT team gave three different scenarios.
Scenario 1:
a) Student registration page will have the following fields to be filled.
Student Name, Address, Grade (Year 1 to 13 loaded in ComboBox), Parent Name
b) User can enter these values and click "Register"
c) Here Student Name and Grade are mandatory fields
d) System will validate for those mandatory fields and will show a error message in the response page
a) Student registration page will have the following fields to be filled.
Student Name, Address, Grade (Year 1 to 13 loaded in ComboBox), Parent Name
b) User can enter these values and click "Register"
c) Here Student Name and Grade are mandatory fields
d) System will validate for those mandatory fields and will show a error message in the response page
e) If validation succeeds, show up the details of the registered student.
Scenario 2:
a) Students can be searched by the following parameters
Student Name, Grade (Year 1 to 13 loaded in ComboBox)
b) User can enter these values and click "Search"
c) System should provide some mock data response based on the search parameter
(keep 5-6 students' details within the java class itself)
d) Search results need to be shown in the table in a new page
Scenario 2:
a) Students can be searched by the following parameters
Student Name, Grade (Year 1 to 13 loaded in ComboBox)
b) User can enter these values and click "Search"
c) System should provide some mock data response based on the search parameter
(keep 5-6 students' details within the java class itself)
d) Search results need to be shown in the table in a new page
Scenario 3:
a) Student marks can be entered entered in the following way
Student Name (StudentName loaded in ComboBox), Grade (1-13 ComboBox), Subject, Marks
b) User can enter these values and click "Add"
c) Here all those fields are mandatory and marks cannot be more than 100
d) System should validate those fields and show it in the response page
I choose Scenario 3 to understand MVC architecture.
I use NetBeans IDE for this project.
The project structure is look like fig.1
Project Name is yschool-mini-niroshan
This project has four JSP pages.
To get source code of this project click below.
https://github.com/Niroshan06/yschool-Nirosh
When I run my project the browser was look like this.
When I click Add button with empty field, warning message was displayed.
When the marks was less than zero or greater than hundred another warning message was displayed.
I use NetBeans IDE for this project.
The project structure is look like fig.1
| fig-1 |
Project Name is yschool-mini-niroshan
This project has four JSP pages.
To get source code of this project click below.
https://github.com/Niroshan06/yschool-Nirosh
When I run my project the browser was look like this.
| fig-2 |
When I click Add button with empty field, warning message was displayed.
| fig-3 |
| fig-4 |
No comments:
Post a Comment