Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java - KFT1 Task 4 RegiStudent Diagrams

Similar presentations


Presentation on theme: "Java - KFT1 Task 4 RegiStudent Diagrams"— Presentation transcript:

1 Java - KFT1 Task 4 RegiStudent Diagrams
by Bernard Nsabimana Student ID: BS - IT IT Java Course Mentors : - Pubali Banerjee, PhD - Cynthia Lang, PE, MSChE Western Governors University

2 UML Required Diagrams UML Use Case Diagrams UML Class Diagrams
UML Sequence Diagrams

3 RegiStudent RegiStudent is an application written using a Java program. The purpose of the application is to maintain registrar database, useful for managing students in school institutions. In this application, there are an abstract superclass called “Student”, and three concrete subclasses: “Graduate”, “UnderGraduate”, and “Part_Time”. MySQL database is the relational database management system (RDBMS) used. NetBeans is used as an integrated development environment (IDE). The application allows users to add new student in the database, update existing student, and delete student from the database. It also helps users to retrieve student’s information from the database. The application calculates also student tuition.

4 Functional Requirements RegiStudent
1) The database “registrar” has “student” table with 10 fields. 2) The script “registrar.sql” can be executed to create and populate the registrar database. 3) Database connections are handled by regiConnect class. 4) Student is the abstract super class with several abstract methods : The calculateTuition() method that calculates student tuition according to student ‘s status and credit hours Resident Graduate : CRHours x 300; Non Resident Graduate : CRHours x 350 Resident UnderGraduate: CRHours x ; Non Resident UnderGraduate: CRHHours x 400; Resident Part_Time : CRHours x 250; Non Resident Part_Time: CRHours x 450; The update() method that updates existing student in the database The add() method that adds new student to the database. The delete() method that deletes existing student record from the database The query() method that retrieves student info from the database by student ID The toString() method that is overridden to display the data variables in student concatenated in a string. 5) Three subclasses inherited from student class are Graduate, UnderGraduate, and Part_Time; The Graduate subclass has two additional attributes : thesisTitle and thesisAdvisor; The UnderGradute subclass has one additional attribute : level; The Part_Time subclass has also one additional attribute : company. 6) The tester class is RegiStudent.

5 Use Case Diagram: RegiStudent
Add student As mentioned in a previous slide, a Use Case diagram is required for Task 4. Use Case Diagrams answer the question: What will the system do? For the MediaManager, a user can maintain an inventory of his/her media holdings, by interacting with a database of the inventory. The interactions consist of adding media, listing all media in the inventory, querying the database for media with a specific ID, and calculating the total cost of the media including shipping. The media can be either DVD or VHS. There are two important parts to a use case. The first part is the Actor, or end user, who is defined by his/her role. The other part is the task or goal, in other words, the use case which is labeled with a strong verb to denote action. Part_Time UnderGraduate Graduate Delete Student Query Student Part_Time UnderGraduate Graduate User Update Student Database Part_time UnderGraduate Graduate RegiStudent

6 Use Case Diagram : RegiStudent - Add Student functional requirement
Add Part_Time Add Graduate Add UnderGraduate Functional Requirement : Number 1 Title: Add Student Description: The user will add student Graduate, or student UnderGraduate or student Part_Time to the collection database. Input: - Graduate: studentID, firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor will be entered; - UnderGraduate: studentID, firstName, lastName, gpa, status, mentor, level will be entered; - Part_Time: studentID, firstName, lastName, gpa, status, mentor, company will be entered. Results of process or output: The student (Graduate, UnderGraduate or Part_Time) is added to the database, and the message: “Successfully New Student Added to the DB” is displayed. Error handling: When the input fails, the message: “"Could not Add New Student to the DB“ is displayed. User Database RegiStudent

7 Use Case Diagram : RegiStudent - Update Student functional requirement
Part_Time Update Graduate Update UnderGraduate Functional Requirement : Number 2 Title: Update Student Description: The student collector will update a chosen field of an existing student (Graduate, UnderGraduate or Part_Time) in the collection database. Input: - Graduate: studentID, and one of firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor fields will be entered; - UnderGraduate: studentID, and one of firstName, lastName, gpa, status, mentor, level fields will be entered; - Part_Time: studentID, and one of firstName, lastName, gpa, status, mentor, company fields will be entered. Results of process or output: The field chosen by the student collector from the existing student(Graduate, UnderGraduate or Part_Time) fiields is updated , and the message: “Successfully Existing Student Updated” is displayed. Error handling: When the input fails, the message: ““Student could not be Updated“ is displayed. Student Collector Database RegiStudent

8 Use Case Diagram : RegiStudent - Delete Student functional requirement
Functional Requirement : Number 3 Title: Delete Student Description: The user will delete student (Graduate, UnderGraduate, or Part_Time) from the collection database. Input: To delete Graduate, UnderGraduate, or Part_Time student from the database, the student collector will only enter studentID. Results of process or output: The student (Graduate, UnderGraduate, or Part_Time) is deleted from the database, and the message: “Successfully Existing Student deleted from the DB” is displayed. Error handling: The message: "Could not delete Existing Student from the DB“ is displayed. User Database RegiStudent

9 Use Case Diagram : RegiStudent - Query Student functional requirement
Query Part_Time Query Graduate Query UnderGraduate Functional Requirement : Number 4 Title: Query Student Description: The user will retrieve student (Graduate, UnderGraduate, or Part_Time) informations from the collection database. Input: - Graduate: studentID will be entered to retrieve firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor from the collection database, and displayed; - UnderGraduate: Also studentID will be entered to retrieve firstName, lastName, gpa, status, mentor, level from the collection database, and displayed; - Part_Time: studentID is entered to retrieve firstName, lastName, gpa, status, mentor, company from the collection database, and displayed. Results of process or output: The student (Graduate, UnderGraduate or Part_Time) informations are retrieved from the collection database and displayed. Error handling: When the iquery fails, the message: “Could not retrieve any information : SQL ERROR“ is displayed. User Database RegiStudent

10 Class Diagram : RegiStudent
<<abstract>> Student - studentID : Integer - firstName : String - lastName : String - gpa : Float - status : String - mentor : String + Student() + setStudentID(stuID : Integer) : void + setFirstName(stuFirst : String) : void + setLastName(stuLast : String) : void + setGpa(stuGpa : Float) : void + setStatus(stuStatus : String) : void + setMentor(stuMentor : String) : void + getStudentID() : Integer + getFirst() : String + getLast() : String + getGpa() : Float + getStatus() : String + getMentor() : String + add() : void + update() : void + delete() : void + query() : void + calculateTuition() : double + toString() : String RegiStudent - stuOption : Integer - menuint : Scanner + main() + AddStudent() : void + UpdateStudent() : void + DeleteStudent() : void + QueryStudent() : void + Tuitionstudent() : void Please note that the abstract methods in the abstract superclass Media are italicized and bold. In the subclasses, the methods from the superclass that are overridden in the subclass are bold. Visibility indicators: + public # protected Private If a variable is underlined that means that it is a static variable. That applies to methods too. Underlined methods are static methods. 1 1 . .* 1 0..1 regiConnect - stuConn : Connection + regiConnect() + makeConnection() : Connection + makeStatement() : Statement + close() : int 0..* 0..* 0..* Part_Time - company : String + Part_Time() +setCompany(stuCompany : String) : void + getCompany() : String + add() : void + update() : void + delete() : void + query() : void + calculateTuition() : double + toString() : String UnderGraduate - level : String + UnderGraduate() +setLevel(stuLevel : String) : void + getLevel() : String + add() : void + update() : void + delete() : void + query() : void + calculateTuition() : double + toString() : String Graduate - thesisTitle : String - thesisAdvisor : String + Graduate() + setThesis(stuThesis : String) : void + setAdvisor(stuAdvisor : String) : void + getThesis() : String + getAdvisor() : String + add() : void + update() : void + delete() : void + query() : void + calculateTuition() : double + toString() : String 0..1 0..1 0..1 1 1 1

11 Sequence Diagram : Add Student
Registudent Student Graduate UnderGrauate Part_Time Database User A sequence diagram provides a timeline of the creation of objects in the application and the messages that are passed between them, showing the sequence in which they occur. The objects are shown across the top. The name of each object is underlined. The vertical timeline shows the lifetime of each object in the processing, as well as the sequence of the messaging between the objects. Sequence Diagrams: Model the object interactions required for each functional scenario. For each Use Case provided in the functional requirements section, at least one sequence diagram should be provided to model the interaction between the objects inside the application. Start program. Show Maijn Menu. Select Add Student Request Student Category (Graduate, UnderGraguate, Part_Time) Select Graduate Select UnderGraduate Select Part_Time Request studentID, firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor Enter studentID, firstName, lastName, gpa, status, mentor, level Enter studentID, firstName, lastName, gpa, status, mentor, company Enter studentID, firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor Enter studentID, firstName, lastName, gpa, status, mentor, level Enter studentID, firstName, lastName, gpa, status, mentor, company Create a Graduate Object Create UnderGraduate Object Create Part_Time Object Call Student Constructor Constructor info Insert Student in database Return success message

12 Sequence Diagram : Update Student
Registudent Student Graduate UnderGrauate Part_Time Database User A sequence diagram provides a timeline of the creation of objects in the application and the messages that are passed between them, showing the sequence in which they occur. The objects are shown across the top. The name of each object is underlined. The vertical timeline shows the lifetime of each object in the processing, as well as the sequence of the messaging between the objects. Sequence Diagrams: Model the object interactions required for each functional scenario. For each Use Case provided in the functional requirements section, at least one sequence diagram should be provided to model the interaction between the objects inside the application. Start program. Show Maijn Menu. Select Update Student Request Student ID Enter Student ID Request Student Category (Graduate, UnderGraguate, Part_Time) Select Graduate Select UnderGraduate Select Part_Time Select a Field to update ( firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor ) Select a Field to update ( firstName, lastName, gpa, status, mentor, level ) Select a Field to update ( firstName, lastName, gpa, status, mentor, company ) Enter New (firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor) Enter New ( firstName, lastName, gpa, status, mentor, level ) Update Graduate Object Update UnderGraduate Object Enter New ( firstName, lastName, gpa, status, mentor, company ) Update Part_Time Object Call Student Constructor Constructor info Update Student in database Return success message

13 Sequence Diagram : Delete Student
Registudent Student Graduate UnderGrauate Part_Time Database User A sequence diagram provides a timeline of the creation of objects in the application and the messages that are passed between them, showing the sequence in which they occur. The objects are shown across the top. The name of each object is underlined. The vertical timeline shows the lifetime of each object in the processing, as well as the sequence of the messaging between the objects. Sequence Diagrams: Model the object interactions required for each functional scenario. For each Use Case provided in the functional requirements section, at least one sequence diagram should be provided to model the interaction between the objects inside the application. Start program. Show Maijn Menu. Select Update Student Request Student ID Enter Student ID Request Student Category (Graduate, UnderGraguate, Part_Time) Select Graduate Select UnderGraduate Select Part_Time Select a Field to update ( firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor ) Select a Field to update ( firstName, lastName, gpa, status, mentor, level ) Select a Field to update ( firstName, lastName, gpa, status, mentor, company ) Enter New (firstName, lastName, gpa, status, mentor, thesisTitle, thesisAdvisor) Enter New ( firstName, lastName, gpa, status, mentor, level ) Update Graduate Object Update UnderGraduate Object Enter New ( firstName, lastName, gpa, status, mentor, company ) Update Part_Time Object Call Student Constructor Constructor info Update Student in database Return success message

14 Sequence Diagram : Query Student
MediaManager Media VHS Database Media Collector A sequence diagram provides a timeline of the creation of objects in the application and the messages that are passed between them, showing the sequence in which they occur. The objects are shown across the top. The name of each object is underlined. The vertical timeline shows the lifetime of each object in the processing, as well as the sequence of the messaging between the objects. Sequence Diagrams: Model the object interactions required for each functional scenario. For each Use Case provided in the functional requirements section, at least one sequence diagram should be provided to model the interaction between the objects inside the application. Start program. Show menu. Select Add. Request ID, title, cost, type of media. Supply ID, title, cost, type of media. Create a VHS Object Call Media constructor Constructor info Insert VHS in database Return success message


Download ppt "Java - KFT1 Task 4 RegiStudent Diagrams"

Similar presentations


Ads by Google