[ Java] Individual Assignment Acknowledgement I am more grateful to my lecturer who gave me moral support and guided me in different matters about the topic. He has been very kind and patient, while suggesting to me the outlines of this assignment, and correcting my doubts. I thank him for his overall support. Last but not the least, I would like to thank my parents who helped me a lot in gathering different information, collecting data and guiding me from time to time in completing this assignment. Despite their busy schedules, they gave me different ideas to make this unique assignment. I am very thankful to everyone who all supported me to complete my assignment effectively and moreover, on time. Thank You 1|Page Individual Assignment Executive summery In this Assignment there are 11 tasks to be outcome. As the first stage of this assignment the coding part was done using the help of my lecturer and after finishing the coding the four types of diagrams (Class diagrams, ER diagram, Sequence Diagram, and use case diagrams) were drawn. That was the first part of this assignment. Then starting from the first task from the assignment was done. The first task was comparing the programming languages and highlighting the Object-Oriented Language and its concepts. Next Task was to make a requirement specification for the system. After doing that all the diagrams were finalized and document correctly. Next part was to highlight the control structures and repetition structures of the coded program. After doing that User manual should be documented with all the onscreen helps and other output messages. Next part was the layer based proposed programming solution and to use comments in the coded program. Finally the testing part was done using the help of my friend and a selfcriticism was made for this system. 2|Page Individual Assignment Table of Contents Acknowledgement 1 Executive summery .................................................................................................................. 2 Table of Figures........................................................................................................................ 5 Table of Tables ......................................................................................................................... 7 Introduction .............................................................................................................................. 8 What is Object-oriented programming and Java Programming? ...................................... 9 JVM Environment ................................................................................................................ 10 A Machine within a Machine ............................................................................................... 10 Requirement Specification for the system ........................................................................... 11 Main requirements for the system ........................................................................................ 12 Use case Diagrams.................................................................................................................. 13 Class Diagrams ....................................................................................................................... 15 Sequence Diagrams ................................................................................................................ 17 Relationship Diagram ............................................................................................................ 22 ER Diagram ............................................................................................................................ 23 Control structures and Repetition structures ..................................................................... 25 Messages for inputs, outputs and onscreen help ................................................................. 26 Tooltip Text and Messages in this system ........................................................................... 28 User Manual of the system .................................................................................................... 29 Some of the Comments used in the coding .......................................................................... 36 Testing Techniques ................................................................................................................ 39 White box Testing Vs Black box Testing ............................................................................ 39 Black box testing of the System ........................................................................................... 39 Test Cases of the System........................................................................................................ 40 Login Process of the System ............................................................................................ 40 3|Page Individual Assignment Student User Interface ...................................................................................................... 40 Lecture List Query ............................................................................................................ 41 Questionnaires about the system of Royal ICT Hub .......................................................... 43 Self-Criticism Report ............................................................................................................. 44 Conclusion and Future Recommendation ........................................................................... 45 References ............................................................................................................................... 46 Appendix ................................................................................................................................. 47 4|Page Individual Assignment Table of Figures Figure 1:- Use Case Diagram SRS........................................................................................... 13 Figure 2:-Use Case Diagram Manage Queries ........................................................................ 14 Figure 3:-Use Case Diagram Manage Student......................................................................... 14 Figure 4:-Use Case Diagram Manage Student Query.............................................................. 15 Figure 5:-Class Diagrams, Student Figure 6:-Class Diagrams, Student Module 15 Figure 7:-Class Diagrams, Login Figure 8:-Class Diagrams, Module 10:-Class Diagrams, Enrollment 16 Figure 9:-Class Diagrams, Lecturer Figure 17 Figure 11:-Class Diagrams, Course Figure 12:-Class Diagrams, Course Module 17 Figure 13:-Sequence Diagrams, Adding New Student ............................................................ 18 Figure 14: Sequence Diagrams, Search by qualification for Student ...................................... 19 Figure 15:-Sequence Diagrams, Search Student ...................................................................... 20 Figure 16:-Sequence Diagrams, Delete Student ...................................................................... 21 Figure 17:-Relationship Diagram ............................................................................................ 23 Figure 18:-ER Diagram............................................................................................................ 24 Figure 19:-For loop .................................................................................................................. 25 Figure 20:- If Else Statement ................................................................................................... 25 Figure 21:-While loop .............................................................................................................. 26 Figure 22:-Tooltip Text and Messages .................................................................................... 28 Figure 23:-Data Source Administrator..................................................................................... 29 Figure 24:-Create new database ............................................................................................... 30 Figure 25:-Select database ....................................................................................................... 31 Figure 26:- Login Form ........................................................................................................... 32 Figure 27:- Student Registration System Form ....................................................................... 33 Figure 28:-Student Form .......................................................................................................... 34 Figure 29:-Query selecting form .............................................................................................. 35 Figure 30:- Query form Search by ........................................................................................... 36 Figure 31:-Three Tier Architecture ................................ Ошибка! Закладка не определена. 5|Page Individual Assignment Figure 32:-White box Testing and Black box Testing ............................................................. 39 6|Page Individual Assignment Table of Tables Table 2:-Login Process ............................................................................................................ 40 Table 3:-Student User Interface ............................................................................................... 41 Table 4:-Lecture List Query..................................................................................................... 42 Table 5:-Questionnaires ........................................................................................................... 43 7|Page Individual Assignment Introduction Royal ICT Hub is an institute which provides various ICT programs for the people who need qualification to obtain a better job. The program managers of the Royal ICT Hub mainly maintain all the information’s of students, lecturers, modules, courses, enrolment and student’s grades details. Importantly the campus manages details of student enrollments to different courses and module grades of each student. Every course is coordinated by selected lecturer and that lecturer is known as the course director for that course. The main problem of this campus is all the records are stored in excel sheets. The program managers face difficulties in searching records when necessary. Also difficult to provide information management when needed. Therefore management decided to develop the system to make their work easier and more efficient. As the Software developer hired by the Royal ICT Hub it is my responsibility to create an error free, effective program with user friendly interfaces, appropriate messages, outputs and menus using Java Programming 8|Page Individual Assignment What is Object-oriented programming and Java Programming? Object-oriented programming is a programming paradigm that uses Objects and their interactions to design applications and computer programs. Basically there are seven OOP concepts used to create an advanced program. These concepts are Object, Class, Data Abstraction and Encapsulation, Inheritance, Polymorphism, Dynamic Binding, Message Passing. From the above seven concepts Data Abstraction and Encapsulation, Inheritance, Polymorphism are very important concepts comparing to other concepts. Data Abstraction and Encapsulation- Basic idea of Encapsulation is wrapping up of data and its functions into a single unit. Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details. Abstraction is "To represent the essential feature while not representing the rear ground details”. Abstraction allows you to target what the thing will rather than however it wills it. Abstraction provides you a generalized read of your categories or object by providing relevant info. Abstraction is that the method of activity the operating sort of associate degree object, associate degreed showing the data of an object in intelligible manner. Inheritance-The Basic idea of Inheritance of forming a new class from an existing class or base class, the new class which is formed if called as derived class. The main thing which is doing by the inheritance concept is reducing the overall code size of the program, which is an important concept in object-oriented programming. There are different types of inheritance level such as Single level inheritance, Multi-level inheritance, Hybrid inheritance, and Hierarchical inheritance. Polymorphisms- This concept is coming along with the inheritance, abstraction and encapsulation. Polymorphism is one of the major building blocks of object oriented programming. In Polymorphisms there two types of techniques such as overriding and overloading. Overriding is form of polymorphism which is used in Java to dynamically bind method from sub class in response to a method call from sub class object referenced by super class type. In case of overloading, you also got multiple methods with same name but different method signature but call to correct method is resolved at compile time using static 9|Page Individual Assignment binding in Java. Overloading is a compile time activity oppose to Overriding which is runtime activity. Basic example for overloading is, if given a variable that is an integer, the function chosen would be to seek a match against a list of employee numbers; if the variable were a string, it would seek a match against a list of names. In either case, both functions would be known in the program by the same name. The main reason to select OOP for the given scenario is because of the main concepts which were discussed earlier. Other than that the given scenario also most applicable for OOP. Reason to select Java under OOP is because Java programs are platform independent, it can run on any PC or any, it is dynamic, simple and robust. These are some of the advantages which Java is supported. (Anon., 2008) JVM Environment An abstract computing machine, or virtual machine, JVM is a platform-independent execution environment that converts Java bytecode into machine language and executes it. Most programming languages compile source code directly into machine code that is designed to run on a specific microprocessor architecture or operating system, such as Windows or UNIX. A Machine within a Machine JVM -- a machine within a machine -- mimics a real Java processor, enabling Java bytecode to be executed as actions or operating system calls on any processor regardless of the operating system. For example, establishing a socket connection from a workstation to a remote machine involves an operating system call. Since different operating systems handle sockets in different ways, the JVM translates the programming code so that the two machines that may be on different platforms are able to connect. 10 | P a g e Individual Assignment Requirement Specification for the system The Royal ICT Hub is a institute which provides various Diploma programs for the people who needs to find a better job. In this campus all the information of the Students, Lecturers, Modules, Courses, Enrollments, Student grading’s and other information are stored in excel sheets, so the Program Managers and other staff members face various kind of difficulties in retrieving data, updating data and deleting data. In this current system Royal ICT Hub facing some common difficulties in the current system such as takes lots of time to retrieving data, updating data or deleting data. Another difficulty is hard to maintaining accurate records and when the number of records increases the time gets increases to find the records. This current system also has the ability to use the system by a single person and the current system can not set permissions to the other staff members. These are some of the drawback or difficulties in the current system. 11 | P a g e Individual Assignment Main requirements for the system Multiple store records. Easy to retrieve data, update data and delete data Interface should be in user friendly manner. Should able to set permissions and should able to have user accounts. Faster and easy procedure. Should able to generate reports. Effective search facility to search any type of information Comprehensive performance reports. Easy Query handling Provides a user friendly menu Totally Secured system Should able to handle more records in lesser time When it comes to requirement specification there two main types such as Functional and Non Functional Requirements which able to fulfill a complete system. The difference between those two is non-functional requirements describe how the system works, while functional requirements describe what the system should do. (Debono, 2012) 12 | P a g e Individual Assignment Use case Diagrams SRS Login Manage Student Grades Manage Student Manage Login Uses Manage Lecturer Produce Reports Manage Course Manage Queries Manage Module Manage Enrollment Figure 1:- Use Case Diagram SRS Manage Queries Manage Student Query Manage Lecturer Query Manage Modules Query 13 | P a g e Individual Assignment Figure 2:-Use Case Diagram Manage Queries Manage Student Add Student Search Include Update Include Delete Display Manage Student Query Figure 3:-Use Case Diagram Manage Student Search by Qualification Search by Gender 14 | P a g e Individual Assignment Figure 4:-Use Case Diagram Manage Student Query Class Diagrams Student Student Module -sID :String -fName :String -lName :String -gender :String -dob :Date -qualification :String -SMID :String -SID :String -MID :String -Released :Date -Marks :Int -Grade :String +Student() +Student(String, String, String, String, Date, String) +setID(String) +getID(): String +setfName(String) +getfName(): String +setlName(String) +getlName(): String +setGender(String) +getGender(): String +setDOB(Date) +getDOB(): String +setQualification(String) +getQualification(): String +StudentModule() +StudentModule(String, String, String, Date, Int, String) +setSMID(String) +getSMID(): String +setSID(String) +getSID(): String +setMID(String) +getMID(): String +setReleased(Date) +getReleased(): Date +setMarks (int) +getMarks (): Int +setGrade(String) +getGrade(): String Figure 5:-Class Diagrams, Student Figure 6:-Class Diagrams, Student Module 15 | P a g e Individual Assignment Login -username :String -password :String +Login() +Login(String, String,) +setusername(String) +getusername(): String +setpassword(String) +getpassword(): String Figure 7:-Class Diagrams, Login Module -MID :String -MName :String -Credit :Int -Level :Int +Module() +Module(String, String, Int, Int) +setMID(String) +getMID(): String +setMName(String) +getMName(): String +setCredit(Int) +getCredit(): Int +setLevel(Int) +getLevel(): Int Figure 8:-Class Diagrams, Module Lecturer Enrollment -lID :String -fName :String -lName :String -telephone :String -email :String -qualification :String -gender :String -eID :String -cID :String -sID :String -enrollDate :Date -expireDate :Date -status :String -result :String +Lecturer() +Lecturer(String, String, String, String, String, String, String) +setlID(String) +getlID(): String +setfName(String) +getfName(): String +setlName(String) +getlName(): String +settelephone(String) +gettelephone(): String +setemail(String) +getemail(): String +setQualification(String) +getQualification(): String +setGender(String) +getGender(): String +Enrollment() +Enrollment(String, String, String, Date, Date, String, String) +seteID(String) +geteID(): String +setcID(String) +getcID(): String +setsID(String) +getsID(): String +setenrollDate(Date) +getenrollDate(): Date +setexpireDate(Date) +getexpireDate(): Date +setsstatus(String) +getstatus(): String +setresult(String) +getresult(): String 16 | P a g e Individual Assignment Figure 9:-Class Diagrams, Lecturer Figure 10:-Class Diagrams, Enrollment Course Module Course -CID :String -CName :String -Duration :Int -Department :String -CDirector :String -CFee :Double -CID :String -MID :String -Semester :Int +Course() +Course(String, String, Int, String, String, Double) +setCID(String) +getCID(): String +setCName(String) +getCName(): String +setDuration(Int) +getDuration(): Int +setDepartment(String) +getDepartment(): String +setCDirector(Date) +getCDirector(): String +setCFee(Double) +getCfee(): Double Figure 11:-Class Diagrams, Course +CourseModule() +CourseModule(String, String, Int,) +setCID(String) +getCID(): String +setMID(String) +getMID(): String +setSemester(Int) +getSemester(): Int Figure 12:-Class Diagrams, Course Module Sequence Diagrams 17 | P a g e Individual Assignment Adding New Student StudentFrame Student StudentDC Student (StdDetails) Adding Student Details Staff New Student Add Student (Student) [Confirmation Message ] Figure 13:-Sequence Diagrams, Adding New Student Search by qualification for Student StudentListFrame StudentDC Search (Qualification) Staff getStudentbyqual (qual) (Student Details) 18 | P a g e Individual Assignment Figure 14: Sequence Diagrams, Search by qualification for Student 19 | P a g e Individual Assignment Search Student StudentDC StudentFrame Search (Student ID) Find Student (ID) Staff (Student Details) Figure 15:-Sequence Diagrams, Search Student Delete Student StudentFrame StudentDC Delete (Student ID) Delete Student (ID) Staff (Confirmation) 20 | P a g e Individual Assignment Figure 16:-Sequence Diagrams, Delete Student 21 | P a g e Individual Assignment Relationship Diagram 22 | P a g e Individual Assignment Figure 17:-Relationship Diagram ER Diagram 23 | P a g e Individual Assignment Figure 18:-ER Diagram 24 | P a g e Individual Assignment Control structures and Repetition structures Control structures and Repetition structures are the primary concept in most high-level programming languages. Basic idea of Control structures and Repetition structures are simply block of codes which will perform a particular task. In other words control structures are blocks of code that dictate the flow of control and the repeating structure. In this system also there are various kinds of Control structures and Repetition structures. Commonly use Control structures and Repetition structures is Java programming is for loops, While Loop, and If else conditions. These are only few Control structures and Repetition structures that which are used in this system. (Anon., n.d.) For loop- Figure 19:-For loop This for loop is used in LecturerFrame.java under UI package. The main reason to use this for loop is because to execute the lecturelist a specific number of times. A for loop is coming under repetition control structure. A for loop is useful to have when how many times a task is to be repeated. If Else Statement- Figure 20:- If Else Statement 25 | P a g e Individual Assignment This If Else Statement is used in StudentDC.java under DC Package. In here reason to use a if else condition is because when getting the fName, lName, gender, DOB and qualification if one of these is not getting the statement will go to else part and return null. The main purpose of an if Else statement is it is optional to have an else statement, which executes when the Boolean expression is false. While loop- Figure 21:-While loop This While loop is used in StudentDC.java under DC Package. The reason to use this while loop is to repeat the task for a certain number of times and it will finally return to Student list (stdList). Messages for inputs, outputs and onscreen help When it comes to a working environment for this system the most important thing is the user friendliness. There are some features that this system is capable of helping the user or making the user easier to work with this system. Mainly in this system there are some tooltip texts which are used to make the user more comfortable in using this system. Other than that for each and every input there is a particular message is displaying in the screen to verify the user 26 | P a g e Individual Assignment that the input has done successfully or not. And also some of the outputs also display some messages according to the work done from this system. 27 | P a g e Individual Assignment Tooltip Text and Messages in this system Figure 22:-Tooltip Text and Messages 28 | P a g e Individual Assignment User Manual of the system Start As the first step user has to connect with the Database Control panel Administrative Tool Data Source (ODBC) After data source there will be a window coming as follows, to connect data source user should press add button and then it will open a new window to create new data source. But if the database is already in the list the user can simply select it and press OK. Figure 23:-Data Source Administrator 29 | P a g e Individual Assignment If the user is creating a new database after pressing the add button user must select Microsoft Access Driver [*mdb *.accdb] and press finish. Figure 24:-Create new database 30 | P a g e Individual Assignment After that user will get a window as follows, and in that window user has to enter the Data Source Name and select the database path and select the database and finally press ok. After that database is successfully added. Figure 25:-Select database After connecting the database the user can open the executable file and simply enter the username and password and login to the system. 31 | P a g e Individual Assignment Figure 26:- Login Form 32 | P a g e Individual Assignment After login to the system user can choose file and select any category. Figure 27:- Student Registration System Form 33 | P a g e Individual Assignment For example here it has select Student, when the user enter to the student interface user can engage with various kinds of operations such as add a student to the system, delete a student from the database and so many. If the user wants to add a student simply user has to fill the information and press add button. If the user is added successful the system will output an message as follows, and also if the student did not added the system also out put an message as “the student did not added”. Figure 28:-Student Form All the other operations also can be done like according to the users necessity. As show in the example user also can handle lectures information, course information, enrollment 34 | P a g e Individual Assignment information, module information, course module information and also user can exit from the system by clicking file and exit. As the final step user can check the query list by clicking the query and selecting a necessary category. Figure 29:-Query selecting form 35 | P a g e Individual Assignment As an example in above picture it has selected Query and then Course List, after that a window will appear as below. After that the user can select any of the department and press search and see the information about courses. Same as that user can select the appropriate director and get the information. Figure 30:- Query form Search by Some of the Comments used in the coding The above picture shows the comment used to mention the declaration of variables. 36 | P a g e Individual Assignment The above picture shows the comment used to mention the set and get methods. 37 | P a g e Individual Assignment The above picture shows the comments which are used to mention the constructors with parameter and without parameter. The above picture show the comments about the resetting the student frame The above picture shown the declaration of the student class, declaration of the student DC and declaration the student list respectively. 38 | P a g e Individual Assignment Testing Techniques White box Testing Vs Black box Testing (Anon., 2012) Figure 31:-White box Testing and Black box Testing Black box testing of the System The system that was made Royal ICT Hub was tested by using a person who does not have the knowledge of Programming has made some feedback on the Program. 39 | P a g e Individual Assignment Test Cases of the System Login Process of the System No Input Expected Output 1 Enter correct Username Login to System Real Output Description Login to System If & Password the username and password are correct it will log to the system. 2 Enter incorrect Login to System Login Failure If the username or password Username & Password is wrong it will display as login failure Table 1:-Login Process Student User Interface No Input 1 Enter required fields Add Student New Student is New student is successfully and press Add button added Without enter any Add Student Student ID, First Student will not add if one record Press Add Name and last of the field is empty. 2 Expected Output button Real Output Description added. name are required fields. 3 Enter Display button Display Student Display Student It information 4 will display all the information students information Reset all If the data will be erased. Enter Reset button with Reset all Nothing will If the fields are empty empty fields happen Enter Reset button after Reset all entering some data into fields 5 6 Enter update button Update student The nothing to reset student If there is a student which it details are will update or if there is no updated student the system outputs error message. 7 Enter find with correct student id a Find student Find student If the student ID is correct the student information will be displayed. 40 | P a g e Individual Assignment Enter 8 find with a Find student Invalid incorrect student id Student If the student ID is incorrect ID it will output invalid student ID. Enter delete with a Delete Student 9 Delete Student correct student id Student will delete if the student id is there in the database. 10 Enter delete with a Delete Student The Student is Student will not delete if the incorrect student id not deleted student id is not there in the database. Enter close 11 Exit from the Exit system from the Entire system will be close. system Table 2:-Student User Interface Same as the Student User Interface all the other interfaces work like this. Lecture List Query No Input 1 Enter Search All in All qualification Expected Output the Real Output Description lecture All the lecture All information be displayed the will information will regarding be displayed information lecture will display which is in the database. If qualification is diploma only the diploma related result will display. 2 Enter All in gender All the lectures All the lectures All the lectures who are who are male and who female display are male male and female will will and female will display. If gender is male display only the male lectures will display. 41 | P a g e Individual Assignment Table 3:-Lecture List Query Same as the Lecture List Query all the other query will work like this. 42 | P a g e Individual Assignment Questionnaires about the system of Royal ICT Hub In this system every command that input by the user won’t get an output command. Results and other outputs are very accurate. The program is in a very user friendly manner. The program has many features such as has an authentication system as entering a password, and this system have Student, lecturer, source, enrollment and many more information of the campus. Retrieving data, updating data and deleting data is very efficient and easy. Program is in a very attractive manner. Question Excellent Efficiency Weak areas Poor Comment Accuracy User friendliness Good Security level Speed of the system Very Good Should have more user accounts Future recommendations Upgrade by having two or more authentication systems Table 4:-Questionnaires 43 | P a g e Individual Assignment Self-Criticism Report Student Registration System which was made to Royal ICT Hub is a pretty good one but mainly there are some weak points also when it comes to a perfect Student Management System. One of the major weak point is in this system there are no separate login for each category, this is a major weak point because when it comes to a business environment there should be a proper security mechanism and also in a business environment there are various types of staff members such as program managers, coordinators, financial and so many, in this type of a environment the system should be able to set permissions according to their working areas. But overall it is a workable system for Royal ICT Hub. Another weak point of this system is the username and password cannot be changed according to the users needs. But as a plus point this system has many features like adding data, displaying data, deleting data, resetting data and many more. In this system mainly user-friendliness is concerned because there are people who work in different knowledge levels, so the system should suited with all the people who are working with is system. Other than the user-friendliness this system has hold any number of information comparing to the previous excel sheet which was used by the project managers. Another important thing is in this system there are no any errors or problems within the system. This system can be further upgraded according to the user’s requirements. 44 | P a g e Individual Assignment Conclusion and Future Recommendation Royal ICT Hub is an institute which helps people to get qualification in ICT programs and various other exams. In this campus there is only a system with excel sheets are having in the moment but as Program manager needs to make a complete Student Registration System for the Royal ICT Hub in order to make their work more easy and efficient. In the system which was proposed there are huge advantages and also there are some weak points when it come to modern world. One of the benefits of the proposed system is in this system there are more features and facilities compared with the current system or the old system. For example retrieving data, updating data and deleting data can be easily done when comparing the old system. Another benefit of this proposed system is any number of information or records can be added to the system with easy method and the system won’t get slower though there are too many records. As an weakness of the proposed system there is no any advanced authentication method or in this system there is only have one account which can not change the username and the password is a weak point of this system. Another weak point is this system can not set permissions or separate user accounts for the staff members of the Royal ICT Hub. Other than that this system is a good system which is more sophisticated than the current system which was used by the campus. So considering all these features the implemented system to Royal ICT Hub is successful and here on wards the work load will be easy and the time will be managed by the Project Manager and other staff members. 45 | P a g e Individual Assignment References Anon., 2008. Basic OOPs Concepts. [Online] Available at: http://oopsconcepts.blogspot.com/ [Accessed 20 05 2016]. Anon., n.d. Control Structures. [Online] Available at: http://www.valid-computing.com/control-structures.html [Accessed 21 05 2016]. Anon., n.d. Play !> and 3-tier, n-tier architecture – Part I. [Online] Available at: http://javathought.wordpress.com/2012/07/04/play-and-3-tier-n-tierarchitecture-part-i/ [Accessed 22 05 2016]. Debono, M., 2012. Functional vs Non Functional Requirements. [Online] Available at: http://reqtest.com/requirements-blog/functional-vs-non-functionalrequirements/ [Accessed 20 05 2016]. Rouse, M., n.d. 3-tier application. [Online] Available at: http://searchsoftwarequality.techtarget.com/definition/3-tier-application [Accessed 22 05 2016]. 46 | P a g e Individual Assignment Appendix 47 | P a g e