UNIVERSITY OF BORDEAUX 1 PÔLES UNIVERSITAIRES FRANÇAIS HO CHI MINH VILLE FINAL REPORT MASTER OF SOFTWARE ENGINEERING (2007 – 2009) UNIVERSITY LEARNING MANAGEMENT SYSTEM Prof.Dr. Robert Strandh Prof.Dr. Anne Dicky Supervisor: Dr. Lưu Thanh Trà Student: Lê Tấn Quan Ho Chi Minh City, 12/2009 UNIVERSITY OF BORDEAUX 1 PÔLES UNIVERSITAIRES FRANÇAIS HO CHI MINH VILLE FINAL REPORT MASTER OF SOFTWARE ENGINEERING (2007 – 2009) UNIVERSITY LEARNING MANAGEMENT SYSTEM Prof.Dr. Robert Strandh Prof.Dr. Anne Dicky Supervisor: Dr. Lưu Thanh Trà Student: Lê Tấn Quan Ho Chi Minh City, 12/2009 ULMS – University Learning Management System Abstract Most of universities in Ho Chi Minh City have changed to the credits scholar system which gives a huge flexibility for students to choose and design their scholar curriculum. However, this requires a good information system to manage students, teachers, curriculums, rooms, as well as accountant. To fulfill the requirement, we develop software called University Learning Manager System - ULMS with partners involved in the system, including training managers, teachers, students, accountants. The main task of the system ULMS performs the following work. Training management: - Building and design training programs for each faculty from which the design of courses for each particular course of study Management of student information such as test scores, personal information Manage the registration of subject’s credit of students, Arrangements and creating classes for each course Registration information management class of teachers - Scheduling of students, teachers Students management: Allowed to register for subjects’ credit, receive schedule. Teachers management: Allowed to select the class lectures, receive timetable Accounting: Check reasonable of credit total and collect tuition money. I use the spiral model, RUP-Rational Unified Process and UML-Unified Modeling Language to analysis and design as show in Chapter 2 of this report. The implementation install ion using JEE architecture, EJB technology and Java language are also shown in chapter 3 of this report. i ULMS – University Learning Management System Contents Abstract ............................................................................................................................................ i Contents .......................................................................................................................................... ii Chapter 1: Introduction ................................................................................................................ 1 1.1. Introduction to internship place ............................................................................................ 1 1.2. Problem................................................................................................................................. 1 1.3. Introduction to some technology and tools was used to develop the system ....................... 2 1.3.1. About technology .......................................................................................................... 2 1.3.1.1. Spiral engineering ................................................................................................... 2 1.3.1.2. RUP - Rational Unified Process with UML – Unified Modeling Language ......... 2 1.3.1.3. Using multi – layer architecture, MVC – model view control , J2EE architecture and EJB technology ................................................................................................................. 4 1.3.2. About tools .................................................................................................................... 4 Chapter 2: Analysis and conception ............................................................................................ 6 2.1. Preliminary research topics and tasks of the practice .......................................................... 6 2.1.1. Detailed description of topics ........................................................................................ 6 2.1.2. Duties of the practice ..................................................................................................... 7 2.2. Consideration and specification of the use cases. ................................................................ 8 2.2.1. General diagram of the ULMS system .......................................................................... 8 2.2.2. Context diagram of the ULMS ...................................................................................... 9 2.3. Use cases of the system ...................................................................................................... 10 2.4. To set up class .................................................................................................................... 12 2.4.1. To set up class use case ............................................................................................... 12 2.4.2. Classes participated in a use case ................................................................................ 13 2.4.3. Description of the sequence diagram........................................................................... 15 2.4.4. Description of activity diagram ................................................................................... 16 2.4.5. Description design class diagram in detail .................................................................. 17 ii ULMS – University Learning Management System 2.5. Modeling application domains ........................................................................................... 18 2.6. Design prototype user interface .......................................................................................... 20 Chapter 3: Implementation......................................................................................................... 22 3.1. Deployment diagram .......................................................................................................... 22 3.2. The system's general design ............................................................................................... 24 3.2.1. Web tier ....................................................................................................................... 24 3.2.2. Business tier ................................................................................................................. 25 3.2.3. Database tier ................................................................................................................ 28 3.3. Implementing the use-case “ to setup classes” ................................................................... 31 3.3.1. Web tier ....................................................................................................................... 31 3.3.2. Business tier ................................................................................................................. 32 3.3.3. Implementing the process of approving the subject registers of students ................... 35 3.3.4. Implementing the process of setup classes for the subject registers of students ......... 36 User manual .................................................................................................................................. 37 Conclusion and in the future work ............................................................................................... 40 Appendix ...................................................................................................................................... 42 Bibliography ................................................................................................................................. 90 iii ULMS – University Learning Management System Chapter 1: Introduction This chapter introduces to the internship place, the main goals of the topics, and the tools supports. 1.1. Introduction to internship place Location: The project was implemented in headquarter of HCM City University of Technology at 268 Ly Thuong Kiet Street, District 10, Ho Chi Minh City, Vietnam. Introduction to HCM City University of Technology (HCMUT) Ho Chi Minh City University of Technology (HCMUT) is the leading university in teaching and researching activities in Vietnam. They play an active role in the fields of talents cultivation and provide manpower with strong technical skills an the Southern areas of Vietnam. Up to May 2008, HCMUT has 11 faculties, 10 science research and industry transferring centers, 4 training centers, 10 functioning offices and one limited company. During the past 30 years since the Liberation of South Vietnam and country unification, 45,000 engineers and Bachelors have graduated from the university. Since 1994, they have trained 20,000 Bachelors of Science, 1,503 Masters and 25 Doctors, many of whom are either keeping management roles, leading experts in state-owned or foreign-investment enterprises of different industries in Ho Chi Minh City and other southern provinces. 1.2. Problem Web application: Building a training management system which implements the following tasks: - Allowing administrators to design the education programs and courses of this programs. - Allowing students to register subjects to study. - Helping the training bureau to arrange the learning classes according to education program. 1 ULMS – University Learning Management System - Allowing teachers to register their available time, registers courses which are responsible for them. The name of this object is University Learning Management System – ULMS. 1.3. Introduction to some technology and tools was used to develop the system To build and develop the University Learning Management System, after studying the documents and the knowledge which I have learnt in master course. Therefore, I decided to choose some technology and tools as: 1.3.1. About technology 1.3.1.1. Spiral engineering Using spiral model to develop this system because it has base advantages as - It is inherited from Waterfall model and Rapid prototyping so it has the advantages of the above two models. - It is divided into six phases with specific tasks which is very convenient for evaluating the development of software in each period. Six phases are: Customer communication: establishing a relationship of communication between customers and the people who develop the system. Planning: This phase constructs plan to develop software based on resources, time and human resources available. Risk analysis: analysis and management of risk. Engineering: Building the representation of the application Construction and release: construction, installation, implementation, test, customer support Customer evaluation: to acquire and repair from the customers’ evaluation 1.3.1.2. RUP - Rational Unified Process with UML – Unified Modeling Language 2 ULMS – University Learning Management System Rational Unified Process is a process to model the system with UML – Unified Modeling Language. It consists of four phases and ten steps. RUP process has many advantages, especially it has the four phases, the ten steps clearly, easy to check and evaluate work in analysis and design period. This figure show an outline of four phases and ten step in Rational Unified Process. Figure 1 - Outline phases and steps of RUP With UML provide many diagrams to view the system by different ways. How to we analyze and design a more comprehensive to avoid many errors. Below figure describes five view ways of Unified Modeling Language. 3 ULMS – University Learning Management System Figure 2 – Outline view of UML 1.3.1.3. Using multi – layer architecture, MVC – model view control , J2EE architecture and EJB technology The advantages of using these technologies are listed below: - J2EE multi-tiers architecture's benefit is that we can deploy each tier on a different server. - Ability to reuse code very well. - Not allow users to call to the entity object directly to protect the integrity of data. Consistent with web applications and distributed data. 1.3.2. About tools In analysis and design period tools were used StarUML, UML2Tool and UMLET are tools to develop the object orient system by UML 2.0. StarUML is free software first time I use it but it isn’t good. UML2Tool can be integrated into eclipse and it can make a class diagram from code. UMLET is benefit as design component diagram of J2EE. I used it in chapter 3. 4 ULMS – University Learning Management System Database MySQL server MySQL server is a tool to manage the database system. It is convenient and easy to adapt with large data systems. MySQLWorkbench is tool to design database schema. Navicat lite is tool to connect and query data instead we call a command line. This tool is convenient for us to write and run query commands by this way more intuitive. In implement period tools was used Java language with eclipse tool is a language "write once, run anywhere". JQuery is tool to design UI. JQuery is a fast and tidy it is more simplifies JavaScript Library. 5 ULMS – University Learning Management System Chapter 2: Analysis and conception This chapter represents the results in the process of analysis and design of University Learning Management System. Figures in this chapter were created by StarUML tool. 2.1. Preliminary research topics and tasks of the practice The main tasks that we have done in this internship are explained in detail from next sections. 2.1.1. Detailed description of topics The purpose of this project is to help universities to easily manage training programs, make courses of programs for each faculty, Manage registration students’ credit, setup classes, registration training classes of teachers, management paid fees. As work the training bureau, students, teachers, accountants to use. Their specific works and binding rules as follows: The training bureau - Design the training programs, courses and announce them to students and teachers. - Management and updating the teachers’ and students’ information - Make rule between the subjects in a course. For example a prerequisite subjects, corequisites subjects, before learning subject. - Set up a class satisfy with the following condition: The number of students in a class of a subject changes from 20 to 30 unless an obligatory subject in a term. A student can’t study two subjects at the same time. There aren’t two different classes in a room at the same time. - Making timetable The duties of accounting: 6 ULMS – University Learning Management System - Check the registration of credit subjects of students when receiving a list of registration. - Calculation and collection fees The duties of Teachers: - Sign up classes to teach - Select the appropriate time - Rules of the registration: A half of day, teacher only teach at a location A teacher only teaches at most three subjects in a term. A teacher can’t teach in two different rooms (class) at the same time. A teacher can choose priority time to teach. - Teacher will receive their timetable (timetable has a teacher’s name, a course’s name, a class’s name, a room’s name, time, a branch). The duties of students: - Register subjects in the term. - Rules of registering subjects: In a term, students only register at most 27 credits. Prerequisite subjects must be completed before registering other subject that are prerequisite subject. - To receive their timetable 2.1.2. Duties of the practice This project was implemented my own with tasks and work schedule as follows - Construct and develop the ULMS - Analyze and design this system by spiral model, RUP with UML 2.0 - Construct database 7 ULMS – University Learning Management System - Install and deploy the system by Java language with JEE 5.0 architecture and EJB 3.0 technology. Schedule Time Work Result Real Time Implementer July 01 to July 15, 2009 Reaching document Detail specification of the project A week Le Tan Quan July 16 to September 30, 2009 Analysis and design system Finish all diagrams of system follows UML 2.0 Eleven week Le Tan Quan October 1 to October 15, 2009 Design database Database of the System A week Le Tan Quan October 16 to December 31,2009 Coding, testing and writing report Code of the system And final report Ten week Le Tan Quan Make slide to represent Slide Two week Le Tan Quan January 01, 2010 to January 8, 2010 2.2. Consideration and specification of the use cases. 2.2.1. General diagram of the ULMS system ULMS system can be simulated a general way 8 ULMS – University Learning Management System Figure 3 – General outline of the ULMS This figure only describes the most general function of the system which I have assume. 2.2.2. Context diagram of the ULMS The base function communication of ULMS system may be simulated a general way 9 ULMS – University Learning Management System Figure 4 - Context diagram of the ULMS This figure describes the primary functionalities that user interact with the system 2.3. Use cases of the system The primary functions of the system are divided into small functions with name and meaning as follows: - Management of faculties, majors and rooms has function to maintain and update information of faculties, majors and rooms. - Management of subjects has function to save and update information of subjects. - Management of students has function to save and update information of students. - Management of teachers has function to save and update information of teachers. 10 ULMS – University Learning Management System - Management of programs and course has function to make training programs and course programs. - To set up class has function to create learning class for students and teaching class for teachers. - Students registered subjects to help students registering subjects. - Teachers registered classes to help teachers registering teaching class. - View timetables to supply a schedule to teacher, student and training. - Management fee of students has function pay tuition. Figure 5- Use case of the ULMS This figure describes the primary use cases of the system. 11 ULMS – University Learning Management System I analyzed and designed ten use cases above but in this report I only present a use case is enough, rest part was put in appendix because they are done similar way, although in the process of building and development of the system is analyzed and designed fully. 2.4. To set up class 2.4.1. To set up class use case a- Summary: - Use case name: set up class. - Purpose: to set up the classes of subjects - Brief: making classes for each subject, each class has class’s name, class’s code, subject’s name, subject’s code, time, room, a student list, student’s name, student’s code. -Main partner: the training bureau. b- Description main scenarios: - Input condition: there are use cases as management of faculties, majors and rooms, students’ registration subjects , management student payment, management of programs and courses. - Main scenarios: a training bureau log in to the system and choose “set up class” the system asked to select a faculty or all, then screen had displayed following as : + “Automatic distribute” : basing oneself on students' registration time, the property of the subjects, number of students of a class, the system approves list of students registered subjects automatically. Students are approved must pay fees and then they will be set up into a class. Students aren't approved must return to register again +“Feedback to students for registration again”: returning students who are not approved to register again. 12 ULMS – University Learning Management System +“Set up ”: the system will divide automatically the number of students who were approved and completed fees to the suitable class for each subjects. + “Assign room and time to class”: the training manager select a room and the time to assign for each class. If he selects the same room or time, the system will not accept. +“Create schedule”: system displays each learning class according to every subjects have students, room and time so that teacher choose teaching classes. +“View class” : to see classes but not rooms and time + “ View all class” : to see all classes An use case below describes the functions that "set up class use case" assumed Figure 6 - To set up use case. 2.4.2. Classes participated in a use case This section, classes only is analysis classes to determine the function and tasks of classes involved in an use case, and shows three layers model as border class, control class and entity class Boundary class: 13 ULMS – University Learning Management System - “W-set up class”: is a main class to communicate between the system and the training bureau, when the training bureau enters a user name and password then the system will display a screen to select a faculty. - “w-distribute students”: this is an interface to arrange all students were registered subjects according class. - “w-assign room and time”: this is an interface to selects a room and time for a class. Control class: - “Ctrl_ Management Set up”: this class which manage and control dividing all students into suitable classes with rooms and time. Domain classes: - “Class time”: when setup time for a learning class, the training must assign one or many times (includes the day in week and section period time). - “Student subject”: in a term, students must register subjects in their course. This class contains the register status of students' subjects (training approving, fee paying, ready to learn). - “Class”: contains the information of a class. Each class belongs to only one subject, only one course, only one term. A class is assigned a teacher and a room. If the subjects of a class is divided into two parts: theory and exercise, this class must be assigned two rooms, one theory room and one exercise room (computer room or practice room). - “Class student”: a group of students will be assigned to a learning class. This class contains this information. - “Room”: contains the information of a room. Each room belongs to only one faculty. There are three types of room: theory, computer, practice. 14 ULMS – University Learning Management System Figure 7- Analytic class diagram of set up class in use case 2.4.3. Description of the sequence diagram This diagram performs the interaction between objects of classes in " set up class" use case. 15 ULMS – University Learning Management System Figure 8- Sequence diagram of setting up class in use case 2.4.4. Description of activity diagram This activity diagram performs all work flow of "set up class" use case 16 ULMS – University Learning Management System Figure 9 - Activity diagram of set up class use case 2.4.5. Description design class diagram in detail This diagram have used two design patterns is state pattern and singleton pattern. Figure 10– Design class diagram in detail of to set up class use case 17 ULMS – University Learning Management System 2.5. Modeling application domains This section its main tasks are changing the concepts of system into the domain or profession class, here is only interested in the attribute and the linkage of the class and call it is a analysis class. There are classes of this system as: - Faculty: contains the information of a faculty. - Major: contains the information of a major. Each major belongs to only one faculty or not belongs to any faculties. - Room: contains the information of a room. Each room belongs to only one faculty. There are three types of room: theory, computer, practice. - Subject: contains the information of subject. Each subject can have a similar subject. A subject has a default credit. - Program: contains the information of a learning program. When set up a learning program, the training must declare the number of terms and the minimum number of credits for this program. - Program subject: The information of this class describes all subjects of a learning program. - Course: contains the information of a course. Each course belongs to only one faculty. When setup an empty course, the training must declare the number of terms and the minimum number of credits for this course. The training can setup a course from a active learning program. - Course subject: this class contains all subjects of a course. A subject has a default credit, but when assigns this subject to a certain course, it can have a different credit. Simply a subject can have different credits on different courses. If a subject of a course is divided to two parts: theory and exercise, this subject will have two credit types: theory credit and exercise credit. - Term: contains the information about starting time and ending time of terms of courses. - Subject rule: In a course, a subject can be learned or passed before another subject. 18 ULMS – University Learning Management System Another case is two subjects must be learned parallel. These subject rules are contained in this class. - Class: contains the information of a class. Each class belongs to only one subject, only one course, only one term. A class is assigned a teacher and a room. If the subject of a class is divided to two parts: theory and exercise, this class must be assigned two rooms, one theory room and one exercise room (computer room or practice room). - Class student: a group of students will be assigned to a learning class. This class contains this information. - Class time: when setup time for a learning class, the training must assign one or many times (includes the day of week and section period time). - Suggest subject: when the number of students registering a subject is not enough to setup class or is redundant, the training will feedback students to register another subject. In this case, the training must return a list of suggest subjects for registering again. This class contains this information. - Time table: contains the information of time table. It contains the information about class, room, time, teacher. - Student: contains the information of a student. Each student belongs to only one course. - Teacher: contains the information of a teacher. Each teacher belongs to only one major. A teacher can teach the three subjects of major. - Student subject: in a term, students must register subjects of their course. This class contains the register status of students' subjects (training approving, fee paying, ready to learn). The subject marks of students are also stored in this class. - Order: contains the fee of a subject according to this subject's credit. Adding associate and attribute: 19 ULMS – University Learning Management System Figure 11 - A simple class diagram of the system 2.6. Design prototype user interface Using activity diagram to design interface of the user prototype 20 ULMS – University Learning Management System Figure 12 - Activity diagram to design prototype user interface 21 ULMS – University Learning Management System Chapter 3: Implementation This chapter represents implementation of each use case by using J2EE architecture and EJB technology. Figures in this chapter were created by uml2Tool tool and MySQLworkbench. 3.1. Deployment diagram The deployment diagram illustrates the physical deployment of system components. This diagram shows the potential deployment of a University Learning Management System across several servers. J2EE multi-tiers architecture's benefit is that we can deploy each tier on a different server. This application can be deployed on three different servers. It is easier to scale, cluster and avoid to the bottlenecks. Database tier: it is setup on MySQL 5 server. File “schema.sql” is used to create tables' structure. File “init_data.sql” can be used to initiate some data for database. EJB business tier is deployed on Jboss 5 server. This server plays an important part in this application. It is an EJB container that contains entity and session beans. These beans are located in the packages “vn.edu.hcmut.ulms.dao.impl”, “vn.edu.hcmut.ulms.service.ejb” and “vn.edu.hcmut.ulms.domain”. Web tier: this tier is deployed on Tomcat 5 servers. It contains JSP pages and servlets to interact with end-users. JSP files are views in MVC. Servlets are controllers in MVC. The web tier uses domain objects or their inherited objects as models in MVC. This tier interacts with the business tier via service APIs and serviceFactory. They are interfaces which are implemented by EJB technology or any technology. In this project, they are implemented by EJB technology and located at EJB tier. 22 ULMS – University Learning Management System Figure 13 - Component diagram of the system 23 ULMS – University Learning Management System 3.2. The system's general design 3.2.1. Web tier The whole application uses a filter “LoginFilter” to filter input requests based on user's role, block un-authorized access. When users logged-in system, based on their roles (which declared when creating), system send them to their suitable page. Student role can access the pages of student with URL pattern “/student/”. Teacher role can access the pages of teacher with URL pattern “/teacher/”. Training role can access the pages of training with URL pattern “/training/” and “/admin/”. Accountant role can access the pages of accountant with URL pattern “/accountant/”. Admin role can access the pages of administrator with URL pattern “/admin/”. In this application, some servlets extend from the below servlet “BaseServlet”, some other servlets don't extend this servlet. 24 ULMS – University Learning Management System The method name of servlets which are extending from BaseServlet is the same as the value of parameter “method” on user's request. Example, when a student view the timetable in this week, student's request contains parameter “method” with value “viewThisWeek” (http://application.domain/student/timetable?method=viewThisWeek). Web server will use the method “viewThisWeek” of servlet “StudentTimeTableServlet” to process this request.(Figure 63 of appendix). Some other servlets which don't extend from BaseServlet process, users' request based on parameter “action”. (Figure 64 of appendix). 3.2.2. Business tier This tier handles the core business logic of the application. The business components are implemented as EJB components with support from an EJB container. These EJB business components include three main component types: service component, DAO component and domain component. In this application, some services interact directly with domains; some other services interact with domains via DAO components. Service components must implement its two business interfaces, one local and one remote. Because DAO components allow only local access, they only implement only one local interface. Both service components and DAO components don’t need to maintain client-specific state information across method invocations, so the same bean instance can be reused to service other client requests. Therefore, they are modeled as stateless session beans. Domain components must be written to the persistent store and must live even when the client’s session with the server is over. Therefore, the domain components are modeled as container-managed persistence entity beans. 25 ULMS – University Learning Management System In the whole application, servlets get services via ServiceFactory. This is a class which is accessible from everywhere and has only one instance. Therefore, this class uses the pattern “singleton”. The services which interact directly with domains will extend from the general class “DomainServiceImpl”. This class contains some general methods such as create(), update(), remove(), getAll() to interact with domain components. 26 ULMS – University Learning Management System The services which interact with domains via DAO components will not extend from the general class “DomainServiceImpl”. (Figure 65 of Appendix). The DAO components which interact directly with domains will extend from the general class “DomainDAOImpl”. This class contains some general methods such as create(), update(), remove(), getAll() to interact with domain components. 27 ULMS – University Learning Management System A domain component is similar to tables in database tier. (Figure 66 of Appendix). 3.2.3. Database tier In EJB tier, an entity is a lightweight persistence domain object. Typically an entity represents a table in a relational database, and each entity instance corresponds to a row in that table. The persistent state of an entity is represented either through persistent fields or persistent properties. Each table in database is persisted with an entity bean. - tbl_faculty: contains the information of a faculty. 28 ULMS – University Learning Management System - tbl_major: contains the information of a major. Each major belongs to only one faculty or not belongs to any faculty. - tbl_room: contains the information of a room. Each room belongs to only one faculty. There are three room types: theory, computer, practice. - tbl_subject: contains the information of subject. Each subject can have a similar subject. When a subject's status is pending, students can register a similar subject to replace it. A subject has a default credit. - tbl_program: contains the information of a learning program. When setup a learning program, the training must declare the number of terms and the minimum number of credits for this program. - tbl_program_subject: The information of this table describes all subjects of a learning program. - tbl_course: contains the information of a course. Each course belongs to only one faculty. When setup an empty course, the training must declare the number of terms and the minimum number of credits for this course. The training can setup a course from an active learning program. - tbl_course_subject: this table contains all subjects of a course. Each subject has a default credit, but when assigned this subject to a certain course, it can have a different credit. Simply a subject can have different credits on different courses. If a subject of a course is divided to two parts: theory and exercise, this subject will have two credit types: theory credit and exercise credit. - tbl_term: contains the information of starting time and ending time of terms of courses. - tbl_subject_rule: In a course, a subject can be learned or passed before another subject. Another case is two subjects must be learned parallel. These subject rules are contained in this table. 29 ULMS – University Learning Management System - tbl_class: contains the information of a class. Each class belongs to only one subject, only one course, only one term. A class is assigned a teacher and a room. If the subject of a class is divided to two parts: theory and exercise, this class must be assigned two rooms, one theory room and one exercise room (computer room or practice room). - tbl_class_student: a group of students will be assigned to a class. This table contain this information. - tbl_class_time: when setup time for a class, the training must assign one or many times (includes the day of week and section period time). - tbl_suggest_subject: when the number of students registering a subject is not enough to setup class or is redundant, the training will feedback to students to register another subject. In this case, the training must return a list of suggest subjects for registering again. This table contains this information. - tbl_timetable: contains the information of timetable. It contains the information about class, room, time, teacher. - tbl_student: contains the information of a student. Each student belongs to only one course. - tbl_teacher: contains the information of a teacher. Each teacher belongs to only one major. A teacher can teach three subjects of major. - tbl_teacher_class: contains the information of the class registers of teacher. A teacher can register many classes. A class can be registered by many teachers. - tbl_student_subject: in a term, students must register subjects of their course. This table contains the register status of students' subjects (training approving, fee paying, ready to learn). The subject’s marks of students are also stored in this table. - tbl_user: contains the information of an user. Each user has a role (admin, training, accountant, teacher, student). An user has different permissions according to his role. 30 ULMS – University Learning Management System - tbl_order: contains the fee of a subject according to this subject's credit. Figure 14 – Database diagram of the system Ten functions of the system which is broken down into small function in part 3 of chapter 2 (2.3) was implemented fully by J2EE multi- layer architecture and EJB technology. They were implemented and presented by similar way. Therefore, here I just present implement way one use case, remainder may see in an appendix. 3.3. Implementing the use-case “ to setup classes” 3.3.1. Web tier 31 ULMS – University Learning Management System - JSP files: - The file “setupclass.jsp”: is the view which enables training to choose faculty to setup classes. - The file “setupclass2.jsp”: is the view which enables training to view the number of students registered each subject, the number of students approved for each subject, the number of students paid free for each subject and the number of students setup class for each subject. - The file “setupclass3.jsp”: is the view which enables training to view set-upped classes to assign room and time for them. - The file “viewDetailSetupClass1.jsp”: is the view which enables training to view the register status of subjects. - The file “viewDetailSetupClass2.jsp”: is the view which enables training to view the list of student assigned to a class. - The file “approveStudentManually.jsp”: is the view which enables training to approve manually the students' subject register. - The file “approveTeacherForClass.jsp”: is the view which enables training to approve teacher for a class. - The file “assignManualRoomAndTime”: is the view which enables training to assign room/time and create schedule for a class. - The file “setupSubjectRegisterAgain.jsp”: is the view which enables training to choose a subject to register again by students. - Servlets: - The servlet “SetupClassServlet” processes is the actions which are related to the process of set-upping classes such as approve the subject register of students, setup classes, create schedule for classes, approve classes for teachers. 3.3.2. Business tier - Clazz component models classes of a university. It is modeled as a container-managed 32 ULMS – University Learning Management System persistence entity bean. - TimeTable component models timetables of a university. It is modeled as a containermanaged persistence entity bean. - SetupClass is a object which contains view the number of students registered each subject, the number of students approved for each subject, the number of students paid free for each subject and the number of students setup class for each subject. It is not modeled. - ClazzTime component contains the information of time (the day of week and section period time) of classes. It is modeled as a container-managed persistence entity bean. - ClazzStudent component contains the information of students of classes. It is modeled as a container-managed persistence entity bean. - SuggestSubject component contains the information of suggest subjects for students's reregistering. It is modeled as a container-managed persistence entity bean. - SetupClassServiceImpl is the component on the requests of servlet processes “SetupClassServlet”. This component interacts with the domain components “Clazz”, “TimeTable”, “SetupClass”, “ClazzTime”, “ClazzStudent”, “SuggestSubject” via DAO components “ClazzDAOImpl”, “TimetableDAOImpl”, “ClazzTimeDAOImpl”, “SuggestSubjectDAOImpl”. It is modeled as a stateless session bean. It calls the service TeacherService to assign teacher for a class, StudentService to assign students to a class, CourseService to get the information of courses, FacultyService to get the information of faculties and SubjectService to get the information of subjects. - ClazzDAOImpl interacts directly with the domain component “Clazz”, “SetupClass” and “ClazzStudent”. It is modeled as a stateless session bean. - TimeTableDAOImpl interacts directly with the domain component “TimeTable”. It is modeled as a stateless session bean. - ClazzTimeDAOImpl interacts directly with the domain component “ClazzTime”. It is modeled as a stateless session bean. 33 ULMS – University Learning Management System - SuggestSubjectDAOImpl interacts directly with the domain component“SuggestSubject”. It is modeled as a stateless session bean. Figure 15 - Implementing the use-case “ to setup classes” 34 ULMS – University Learning Management System 3.3.3. Implementing the process of approving the subject registers of students The below figure is the process flow of approving the subject registers of students. Figure 16 - The process flow of approving the subject registers of students The method “processAcceptRegisterSubject” of code section (as figure 72.1 in Appendix) Java file “SetupClassServiceImpl” implements that flow. 35 ULMS – University Learning Management System 3.3.4. Implementing the process of setup classes for the subject registers of students The below figure is the process flow of setup classes for the subject registers of students. Figure 17- Process flow of setup classes for the subject registers of students The method processSetupClass of of code section (as figure 72.2 in Appendix) Java file SetupClassServiceImpl implements that flow. 36 ULMS – University Learning Management System User manual Training: a. Management of learning programs: - - - - - To add a new program: Login → Manage programs and courses → Add a new program → Save. To list programs: Login → Manage programs and courses → View programs. To edit a program: Login → Manage programs and courses → View programs → Edit → Save. To assign subjects to programs: Login → Manage programs and courses → View programs → Edit the subjects of this program → Save. b. Management of learning courses: To add a new empty course: Login → Manage programs and courses → Add a new empty course → Save. To add a new course from a program: Login → Manage programs and courses → Add a new course from a program → Save. To list courses: Login → Manage programs and courses → View courses. To edit a course: Login → Manage programs and courses → View courses → Edit → Save. To assign subjects to courses: Login → Manage programs and courses → View courses → Edit subject credit for course → Save. To assign rules for courses' subjects: Login → Manage programs and courses → View courses → Edit subject rule for course → Save. To edit terms for courses: Login → Manage programs and courses → View courses → Edit course's terms → Save. c. Management of faculties: To add a new faculty: Login → Manage faculties and room → View faculties → Add. To edit a faculty: Login → Manage faculties and room → View faculties → Update. To list faculties: Login → Manage faculties and room → View faculties. d. Management of majors: To add a new major: Login → Manage faculties and room → View majors → Add. To edit a major: Login → Manage faculties and room → View majors → Update. To list majors: Login → Manage faculties and room → View majors. e. Management of rooms: To add a new room: Login → Manage faculties and room → View rooms → Add. To edit a room: Login → Manage faculties and room → View rooms → Update. To list rooms: Login → Manage faculties and room → View rooms. 37 ULMS – University Learning Management System f. Management of subjects: - - - - - To add a new subject: Login → Manage subjects → Add a new subject. To edit a subject: Login → Manage subjects → Edit. To list subjects: Login → Manage subjects. To pending a subject: Login → Manage subjects → pending. g. Management of students: To add a new student: Login → Manage students → Add a new student. To edit the information of a student: Login → Manage students → Edit info. To list students: Login → Manage students. To edit the marks of a student: Login → Manage students → Edit marks. h. Management of teachers: To add a new teacher: Login → Manage teachers → Add a new teacher. To edit the information of a teacher: Login → Manage teachers → Edit. To list teachers: Login → Manage teachers. i. Setup classes: Approving automatically students' subject register: Login → Setup Classes → Choose faculty → Automatic distribute. Approving manually students' subject register: Login → Setup Classes → Choose faculty → Manual distribute. To setup class: Login → Setup Classes → Choose faculty → Setup class. To add a subject for registering again: Login → Setup Classes → Choose faculty → Allow students to re-register this subject to replace other subject. To assign room/time and create schedule for classes: Login → Setup Classes → Choose faculty → View Classes → Assign manual room and time. To teachers for classes: Login → Setup Classes → View all Classes → approve a teacher. j. View timetable: To view timetable: Login → View timetable. Student: a. View timetable: Login → View timetable. b. View mark: Login → View marks. c. Register subjects: Login → Register subjects. Teacher: 38 ULMS – University Learning Management System a. View timetable: Login → View timetable. b. Register classes: Login → Register class. Accountant: - a. Setup payment free: Login → Setup payment free. b. Manage student payment: Login → Manage student payment. 39 ULMS – University Learning Management System Conclusion and in the future work After more than six month of design and implementation, I almost finish the basic functions and rules of the system ULMS including: The training bureau - Design the training programs, courses - Management and updating the teachers’ and students’ information - Make rule between the subjects in a course for example a prerequisite subjects, co-requisites subjects, before learning subject. - Set up a class satisfied the following condition: Automatic distribute the number of students in a class of a subject changes from 20 to 30, unless an obligatory subject in a term . Check credit total of students’ registration A student can’t study two subjects at the same time. There aren’t two different classes in one room at the same time. - Making timetable Accounting: - Check the registration of credit subjects of students when receiving a list of registration and tuition fees - Calculate and collect fees Teachers: - Sign up classes to teach - Select the appropriate time 40 ULMS – University Learning Management System - Rules of the registration: A teacher only teaches at most three subjects in a term. A teacher can’t teach in two different rooms (class) at the same time. A teacher can choose priority time to teach. - Teacher will receive a timetable of them (timetable has a teacher’s name, a course’s name, a class’s name, a room’s name, a branch). Students: - Registration subjects to learn in the term. - Rules of registering subjects: In a term, students only register at most 27 credits. Prerequisite subjects must be completed before registration other subject that are prerequisite subject. - Receive a timetable. But the system also need to continue perfecting in the future: Of functions such as priorities selected teaching time by teachers are taught must be made more optimal. A half of day teacher only teach at a location will installed in future. In the future work, we continue to build an algorithm to assign automatically classrooms, time for each class. The pigeon principle (Dirichlet’s principle), dynamic program and the Fibonacci array are the foundation theory to build it. The idea that each learning class of the subject is a separate object. A set include a learning hour, day of week, day of the month, room name will be a box. Dynamic programming algorithm will help to take objects in those box with certain rules. Need to deploy application of design patterns to optimize code of the system. Easily reuse the code later. 41 ULMS – University Learning Management System Appendix Figures of chapter2 Management of faculties, majors and rooms Figure 18 - Use case diagram of “management of faculty & room use case” Figure 19 – Analytic class diagram of management of faculties, major and room use case 42 ULMS – University Learning Management System Figure 20 – Sequence diagram of management of faculties, major and room use case Figure 21 – Activity diagram of management of faculties, major and room use case 43 ULMS – University Learning Management System Figure 22 – Detail class of management of faculties, major and room use case 44 ULMS – University Learning Management System Management of subjects Figure 23 - The management of subjects use case Figure 24 - Analytic class of management of subjects use case 45 ULMS – University Learning Management System Figure 25 - Sequence diagram of management of subjects in use case Figure 26 - Activity diagram of management of subjects in use case 46 ULMS – University Learning Management System Figure 27 – Detail design of to management of subject use case 47 ULMS – University Learning Management System Management of students: Figure 28 – Management of students use case Figure 29 - Analytic class diagram of the management of students in use case 48 ULMS – University Learning Management System Figure 30 - Sequence diagram of management of students in use case Figure 31 - Activity diagram of management of students use case 49 ULMS – University Learning Management System Figure 32 – detail design of to management of students use case 50 ULMS – University Learning Management System Management of teachers Figure 33 - The management of teachers use case Figure 34 - Analytic class diagram of the management of teachers in use case 51 ULMS – University Learning Management System Figure 35 - Sequence diagram of management of teachers in use case Figure 36 - Activity diagram of management of teachers use case 52 ULMS – University Learning Management System Figure 37– Detail design of management of teachers 53 ULMS – University Learning Management System Management of programs and courses Figure 38 - Management of programs and courses use case Figure 39 - Analytic class of the management of programs and courses in use case 54 ULMS – University Learning Management System Figure 40 - Sequence diagram of the management of program and course in use case Figure 41 - Activity diagram of the management of programs and course use case 55 ULMS – University Learning Management System Figure 42 – Detail design of the management program and course use case 56 ULMS – University Learning Management System Students register subjects Figure 43 - students register subjects use case Figure 44 - Analytic class diagram of students register subjects use case 57 ULMS – University Learning Management System Figure 45 - Sequence diagram of the subject’s register students in use case Figure 46 - Activity diagram of Students register subjects use case 58 ULMS – University Learning Management System Figure 47 – Detail design of students register subjects use case 59 ULMS – University Learning Management System Teachers register classes Figure 48 - The teachers register classes use case Figure 49 - Analytic class diagram of the subjects register teachers in use case 60 ULMS – University Learning Management System Figure 50 - Sequence diagram of the class’s register of teacher Figure 51 - Activity diagram of Teachers register classes use case 61 ULMS – University Learning Management System Figure 52– Detail design of teachers register class use case 62 ULMS – University Learning Management System View time table Figure 53 - The view time table use case Figure 54 - Analytic class diagram of view timetable use case 63 ULMS – University Learning Management System Figure 55 - Sequence diagram of view timetables in use case Figure 56 - Activity diagram of view time table use case 64 ULMS – University Learning Management System Figure 57 – Detail design of view timetable use case 65 ULMS – University Learning Management System Management students pay fee Figure 58 - Management pay fee use case Figure 59 - Analytic class diagram of management pay fee use case 66 ULMS – University Learning Management System Figure 60 - Sequence diagram of management pay fee use case Figure 61 - Activity diagram of to management pay fee 67 ULMS – University Learning Management System Figure 62– Detail design of to management pay fee use case 68 ULMS – University Learning Management System Figures of chapter 3 Figure 63– Servlet classes are extended from BaseSevlet class 69 ULMS – University Learning Management System Figure 64– Servlet classes aren’t extended from the BaseServlet class 70 ULMS – University Learning Management System Figure 65 - Interface of a service packet in business ( serviceModel.umlClass) 71 ULMS – University Learning Management System Figure 66– Domain component (domainModel.umlClass) 72 ULMS – University Learning Management System Figure 67 - Implementing the use-case “Management faculties, majors and rooms” 73 ULMS – University Learning Management System Figure 68 - Implementing the use-case “Management of subjects” 74 ULMS – University Learning Management System Figure 69 - Implementing the use-case “Management of students” 75 ULMS – University Learning Management System Figure 70 - Implementing the use-case “Management of teachers” 76 ULMS – University Learning Management System Figure 71 - Implementing the use-case “Management of programs and courses” 77 ULMS – University Learning Management System Figure 72 - Implementing the use-case “To setup classes” Figure 72.1 - the method “processAccetRegisterSubject” @Stateless public class SetupClassServiceImpl implements SetupClassService,SetupClassServiceRemote { @EJB private ClazzDAO clazzDAO; @EJB private CourseDAO courseDAO; @EJB private SuggestSubjectDAO suggestSubjectDAO; @EJB private ClazzTimeDAO clazzTimeDAO; @EJB private TimeTableDAO timeTableDAO; public void processAcceptRegisterSubject(String subId, String courseId) { // get the list of registered students List<StudentSubject> stSubList = getRegisterStudentByCourseIdAndSubjectID(subId, courseId, StudentSubject.STATUS_PENDING); CourseSubject cs = courseDAO.findCourseSubjectBy(courseId, subId); Date date = new Date(); Term term = courseDAO.getCurrentTermByCourseId(courseId,date); int subProperty = cs.getProperty(); int total = stSubList.size(); int clazznum = total/Clazz.MIN_AMOUNT_STUDENT; if(subProperty==Subject.Obligatory && cs.getTerm()==term.getTerm()){ //this subject is obligatory and it is studied in the current term for(int i=0;i<total;i++){ StudentSubject ss = stSubList.get(i); 78 ULMS – University Learning Management System ss.setStatus(StudentSubject.STATUS_TRAINING_ACCEPTED); try { //accept all registered student for this subject ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } }else{ if(clazznum>=2){ for(int i=0;i<total;i++){ StudentSubject ss = stSubList.get(i); ss.setStatus(StudentSubject.STATUS_TRAINING_ACCEPTED); try { //accept all registered student for this subject ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } }else{ // the number of student must register again int againRegisterNum = total; if(total>=Clazz.MAX_AMOUNT_STUDENT) againRegisterNum = total - Clazz.MAX_AMOUNT_STUDENT; else if(total>=Clazz.MIN_AMOUNT_STUDENT) againRegisterNum = 0; for(int i=0;i<(total-againRegisterNum);i++){ StudentSubject ss = stSubList.get(i); ss.setStatus(StudentSubject.STATUS_TRAINING_ACCEPTED); 79 ULMS – University Learning Management System try { ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } } } } } Figure 72.2 - The method processSetupClass @Stateless public class SetupClassServiceImpl implements SetupClassService,SetupClassServiceRemote { @EJB private ClazzDAO clazzDAO; @EJB private CourseDAO courseDAO; @EJB private SuggestSubjectDAO suggestSubjectDAO; @EJB private ClazzTimeDAO clazzTimeDAO; @EJB private TimeTableDAO timeTableDAO; public void processSetupClass(String subId, String courseId) { // get the list of free-paid students 80 ULMS – University Learning Management System List<StudentSubject> stSubList = getRegisterStudentByCourseIdAndSubjectID(subId, courseId, StudentSubject.STATUS_ACCOUNTANT_ACCEPTED); CourseSubject cs = courseDAO.findCourseSubjectBy(courseId, subId); Subject sub = cs.getSubject(); Course course = cs.getCourse(); Date date = new Date(); Term term = courseDAO.getCurrentTermByCourseId(courseId,date); int total = stSubList.size(); int clazznum = total/Clazz.MIN_AMOUNT_STUDENT; if(clazznum>=2){ int mod = total%clazznum==0?0:(total%clazznum)/clazznum + 1; int studentNumPerClass = total/clazznum + mod; int clazzcount = clazzDAO.getCountClassByCourseIdAndSubjectId(subId, courseId, term.getTerm())+1; for(int j=0;j<clazznum;j++){ String clazzCode = sub.getId()+"-"+course.getId()+ "-" + (clazzcount+j); String clazzName = sub.getName() + "-" + course.getName()+ "-Class " + (clazzcount+j); Clazz zz = new Clazz(); zz.setCode(clazzCode); zz.setName(clazzName); zz.setCourse(course); zz.setSubject(sub); zz.setTerm(term.getTerm()); zz.setTheoryCredit(cs.getTheoryCredit()); zz.setPractiveCredit(cs.getPractiveCredit()); zz.setComputerCredit(cs.getComputerCredit()); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 7); cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); Date d = cal.getTime(); zz.setStartDate(d); Clazz zzRS = clazzDAO.create(zz); 81 ULMS – University Learning Management System int end = Math.min((j+1)*studentNumPerClass, total); for(int i=j*studentNumPerClass;i<end;i++){ StudentSubject ss = stSubList.get(i); Student stud = ss.getStudent(); ClazzStudent zzstud = new ClazzStudent(); zzstud.setClazzId(zzRS.getId()); zzstud.setStudentId(stud.getId()); clazzDAO.createClazzStudent(zzstud); try { // update the status of register ss.setStatus(StudentSubject.STATUS_READY_TO_LEARN); ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } } }else{ if(total<=Clazz.MAX_AMOUNT_STUDENT){ int clazzcount = clazzDAO.getCountClassByCourseIdAndSubjectId(subId, courseId, term.getTerm())+1; String clazzCode = sub.getId()+"-"+course.getId()+ "-" +clazzcount; String clazzName = sub.getName() + "-" + course.getName()+ "-Class "+clazzcount; Clazz zz = new Clazz(); zz.setCode(clazzCode); zz.setName(clazzName); zz.setCourse(course); zz.setSubject(sub); zz.setTerm(term.getTerm()); zz.setTheoryCredit(cs.getTheoryCredit()); 82 ULMS – University Learning Management System zz.setPractiveCredit(cs.getPractiveCredit()); zz.setComputerCredit(cs.getComputerCredit()); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 7); cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); Date d = cal.getTime(); zz.setStartDate(d); Clazz zzRS = clazzDAO.create(zz); for(int i=0;i<total;i++){ StudentSubject ss = stSubList.get(i); Student stud = ss.getStudent(); ClazzStudent zzstud = new ClazzStudent(); zzstud.setClazzId(zzRS.getId()); zzstud.setStudentId(stud.getId()); clazzDAO.createClazzStudent(zzstud); try { // update the status of register ss.setStatus(StudentSubject.STATUS_READY_TO_LEARN); ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } }else{ int clazzcount = clazzDAO.getCountClassByCourseIdAndSubjectId(subId, courseId, term.getTerm())+1; for(int j=0;j<2;j++){ String clazzCode = sub.getId()+"-"+course.getId()+ "-" + (clazzcount+j); String clazzName = sub.getName() + "-" + course.getName()+ "-Class " + (clazzcount+j); 83 ULMS – University Learning Management System Clazz zz = new Clazz(); zz.setCode(clazzCode); zz.setName(clazzName); zz.setCourse(course); zz.setSubject(sub); zz.setTerm(term.getTerm()); zz.setTheoryCredit(cs.getTheoryCredit()); zz.setPractiveCredit(cs.getPractiveCredit()); zz.setComputerCredit(cs.getComputerCredit()); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 7); cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); Date d = cal.getTime(); zz.setStartDate(d); Clazz zzRS = clazzDAO.create(zz); int begin=0,end=0; if(j==0){ begin = 0; end = Clazz.MAX_AMOUNT_STUDENT/2; }else{ begin = Clazz.MAX_AMOUNT_STUDENT/2; end = total-begin; } for(int i=begin;i<end;i++){ StudentSubject ss = stSubList.get(i); Student stud = ss.getStudent(); ClazzStudent zzstud = new ClazzStudent(); zzstud.setClazzId(zzRS.getId()); zzstud.setStudentId(stud.getId()); clazzDAO.createClazzStudent(zzstud); try { // update the status of register ss.setStatus(StudentSubject.STATUS_READY_TO_LEARN); 84 ULMS – University Learning Management System ServiceFactory.getInstance().getStudentService().updateStudentSubject(ss); } catch (ServiceNotFoundException e) { e.printStackTrace(); } } } } } } } 85 ULMS – University Learning Management System Figure 73 - Implementing the use-case “Students register subjects” 86 ULMS – University Learning Management System Figure 74 - Implementing the use-case “Teachers register classes” 87 ULMS – University Learning Management System Figure 75 - Implementing the use-case “View timetable” 88 ULMS – University Learning Management System Figure 76 - Implementing the use-case “Management students' pay fees” 89 ULMS – University Learning Management System Bibliography [1] Roger Pressman Software Engineering A Practitioner’s Approach fifth edition McCraw-Hill [2] Design patterns in java Steven John Metsker, William C. Wake [3] Ebook The Java EE 5Tutorial For Sun Java System Application Server 9.1 [4]http://www.menloinnovations.com/freestuff/whitepapers/rup.htm [5]http://www.augustana.ab.ca/~mohrj/courses/2000.winter/csc220/papers/rup_best_practices/ru p_bestpractices.html [6] http://www-01.ibm.com/software/awdtools/rup/ [7] http://en.wikipedia.org/wiki/IBM_Rational_Unified_Process [8]http://www.ideotechnologies.com/documentation/sweetdeven/architecture_concepts_cles/architecture/multicouche.htm [9] http://jquery.com [10] http://www.navicat.com 90