Object Oriented Development With Java Documentation JJ
Object Oriented Development With Java Documentation JJ
Intake Code
UC2F1310IT(NC)
Hand-in Date
18 July 2014
Lecturer
(Jacobson, 2003)
10
11
12
13
Login
RegisterStudent
-End4
-access
-endOfFile
*
+login()
Add Programme
#newProgramme : string
#programme1 : string
#studentEmail1 : string
+AddProgramme()
-End3
-End4
1
-End3
User
1
AddStudent
-username : string
#newStudent : string
* -password : string
#studentName : string
-userType : string
#studentID : string
1 -name : string
#educationLvl : string
#studentEmail : string -End4 -studentName : string
-studentID : string
-End3
+addStudent()
-educationLvl : string
-studentEmail : string
AddUser
+getUsername()
#name
*1 +getPassword()
#userType
+getUserType()
#username
+getName()
#password
-End3
-End4+getName()
#newUser
+getStudentID()
+getEducationLvl()
+AddUser()
+getStudentEmail()
+setUsername()
+setPassword()
+setUserType()
+setName()
+setStudentName()
+setStudentID()
+setEducationLvl()
+setStudentEmail()
+randomInt : int
-fname : string
-s : string
-input1 : string
-eventNameA : string
+generatePDF()
-End4
*
-End4
-End4
-End3
1
-End3
event
-End3
1
1
-programme : string
-externalEntity : string
-eventType : string
-eventName : string
-eventDate : string
-venue : string
-eventFee : string
+getEType() : string
+getEFee() : string
+getEName() : string
+getEDate() : string
+getEVenue() : string
+getProgramme() : string
+getExternalEntity() : string
+setEType()
+setEName()
+setEDate()
+setEFee()
+setEVenue()
+setProgramme()
+setExternalEntity()
1
1
+deleteEvent()
: bool
SelfRegister
*
-randomInt
-line
-input1
-eventNameA
-filename
+generatePDF()
interface
eventInterface
+sendEmail()
sendInvitation
+s : string
+input1 : string
+endOfFile : bool
+searchEvent()
GenerateEventBrochure
-End4
-End3
+randomInt : int
+line : string
+eventNameA : string
+searchEvent()
ApproveEvent
*
1 #Edata : string
+eventNameA
+eventTypeA
+eventDateA
+VenueA
*
-End2
+eventFeeA
+approveEvent()
-End4
-End3-End1
1*
-End3 -End3
*
+notApproveEvent()*
*
-End2
PC
-End1
EventDetails
-End2
GenerateReport
1 -End1
-End4
UpdateEvent
-End4
+endOfFile : bool
Lecturer
+eventDetail()
-endOfFile : bool
+i : int
1
+endOfFile : bool
+SendInvitation()
-s : string
*
+c : char
+str : string
+updateEvent()
-eventNameA : string
+ViewEvent()
1
-Edata : string
+a : string
+RegisterStudent()
-input : string
1
+eventNameA : string
+addEvent()
+SetReminder()
-input1 : string
+eventTypeA : string
*
-End2
-vari : string
*
-End2
+eventDateA : string
-rate : string
-End1
+VenueA : string
HOS
-rate1 : string
+eventFeeA : string
-End2
*
-rate2 : string
AGL
Student
+option : int
+generatePDF()
+AddProgramme()
+searchEvent()
+generatePDF2()
+ApproveEvent()
+updateEvent()
+AddProgramme()
+ViewEvent()
+generatePDF3()
+AddStudent()
+deleteEvent()
+ApproveEvent()
+SelfRegister()
+AddUser()
+AddUser()
+GenerateReport()
+GenerateReport()
1
-End1 -End1
1
14
Activity Diagram
Login
Figure 2Login
15
Produce Report
16
Sent Invitation
17
Update Event
18
19
20
Self-register
21
Set Reminder
22
While developing this system, 2 types of access specifiers have been use in the classes. For
private data member, it is only accessible by the members of the same class. It makes the private
data more secure. For example, all the login username and password are private.
For the rest of the function and data are using public access specifiers. The reason of setting
public is provide flexibility to the programmer. You can call add, update, delete and search event
methods easily from anywhere.
23
In the code above, an object of event class which named as eventObj is created. Its passing
the event variable to the event class constructor, which will be processed and save into the
private data field.
Figure 21 Object used to call the class and display the GUI of the class
Heres another example of usage of object. An object of HOS class which named as a is
created. That object will be used to display the HOS (which is head of school main menu page)
form.
24
Figure 22Constructor
In the diagram above shows the process of reading the event information from txt file to the
combo box. If this portion of code is not put in the constructor, but put inside a methods call
readComboBox function, the combo box will remain empty until that method is called. (SINGH,
2010)
25
To use the polymorphism technique (method overloading) as shown as image above, you are
required to use an object to call this constructor. Moreover, it must use the same data types and
same numbers of arguments to determine which version of overloaded constructor I actually
called. (SINGH, 2010)
26
27
Figure 26Inheritance
In the diagram above, the login class is inherit the javax.swing.JFrame class. The child class is
inherit some methods of the parent class like getContentPane () and setDefaultCloseOperation.
(IBM, 2013) If the login class does not inherit from the javax.swing.JFrame class, the sub class
cannot use those methods shown above. Coding on both methods have to be typed again in the
sub class, which make the code redundant. Moreover, it allows the child class inherits methods
of the parent class to use the graphical user interface component like label, text field, frame, et
cetera while developing the system. (RajKumar Buyya, S Thamarai Selvi, Xingchen Chu, 2009)
28
Figure 29 Interface
29
The code above shows the process of reading the binary file data from even txt file. The code
will read the file from the beginning until the end of the file. If the object of event is found, it
will read every single details of the event. The event name will be populated into the combo box
as shown in the image below.
30
In order write data to a binary file, the keywords of FileOutPutStream have to be used. (User.txt)
represent the path of the file where the data to be saved and the (true) represent the file open option.
(Oracle, 2014)
Array will be used to save every single data of the user, which are user type, user name and password.
After that, writeUTF will encode the data as UTF-8 and write it into the file.
(tutorialspoint, 2014)
31
To read from a txt file, first you have to open the file. Moreover, a scanner is needed to read a
file. The scanner will capture the data from the text field and search it one by one in the txt file.
If the event data is found in the txt file, all the event data will be saved into array.
32
PrintWrite.print methods have been use to print the string to the approve event file. There are 4
text fields in the GUI, get methods is used to get the value of the data and pass it to the variable.
After that, the print writer will print the information of event into the file. Once the process is
completed, the file have to be closed and a message box is appeared to notify user the event has
been approved. Exceptions handling also have been use in the code above. If the file does not
found, and there is no try catch coding in the class, the system will crash.
(tutorialspoint, 2014)
33
Figure 36 Login
I have put several backgrounds in the system interface. In order to put a background, I have to
use a label. The image above shows the result of putting image at the icon of the label.
Validation purpose
The code above is used in a text field which allows the user to enter numbers only. If user tries to
enter anything other than number, it will not show in the text field.
34
A jar named itext is needed to include in the project and the programmer should import the thing
shown above in order to write the content of text field into the pdf file.
Below shows the code needed to write things into a PDF file format. Firstly, a pdf file of certain
size is created. After that, the programmers are required to name the pdf file. Next, open the file
and write all the content in a places call paragraph. Once all the paragraph is added into the pdf
file, the process of writing is completed; the user is required to close the file.
35
In order to successfully send an email with words or attachments, the activation jar and mail jar are a must
to be included in the class path to make this process to be success. After that, you are now able to use the
java API by importing it in the top of the class. To send an email, simple mail transfer protocol (SMTP) is
needed. You are required to enable this protocol, set the host, set the port, enter sender email ID and
password and enter valid recipient email. (point, 2014)
36
37
By clicking logout button in every page of the system, the user will be log off from the system and will be
directed back to login page.
Both of the users are having same roles in the system. In this page, it allows them to create a
new programme and manage the role of the staff by assigning the lecturer to become a
programme coordinator or an administrator. Moreover, all the event approval can be done on this
page also. In additional, the user can produce 3 kinds of reports in the system, which is event
summary report, event detail report and also event exception report.
38
The page above is the main menu of programme coordinator. It allowed the user to create event.
If there is any error in the information, the user can update it by clicking the mange event button.
If the event is created wrongly, the user can also remove the event data in that page. Moreover,
once the event is approved, the user can send invitation to filtered group of students and staffs.
This user can also register student to the event.
In lecturer main menu, lecturer can read the details of the events and download the event
brochure to encourage more students on participating on the events of the school.
39
The student can register themselves into the event that organized by the school. Once they have
completed registration process, the system will send an email which attach with receipt to the
student. Moreover, the student can read deeper details of the event in their main menu.
In this page, the HOS / AGL can add program for the system. If successfully add the programme
information into database, a message box will be pop up.
40
In this page, the HOS and AGL can add student. The information will be useful while inviting student to
event based on the education level. Moreover, the email will be used to send invitation to the student.
In this page, the Hos and AGL can assign the roles of staffs to become a HOS, AGL, lecturer or admin.
41
In this page, all events added by the programme coordinator will be approved or not approved by the
HOS and AGL.
42
43
In this page, lecturer can enter their preferable event and get the brochure by entering their email.
The event brochure will be generated and sent to the lecturer email so that the lecturer can use
that brochure to promote to his /her students.
In this page, the programme coordinator can register student to the event. If an event fee is
required for the student to join the event, the programme coordinator will collect the fees from
44
Figure 61 self-register
In this page, student can register themselves to the event on their own.
In this page, programme coordinator can select group of person they wanted to select, after that,
select the person of that group they the user want to send invitation to. Once send button is
clicked, the email invitation is send to the person via email.
45
In this page, the user can manage the event details, such as update or delete the event.
In this page, it will show all the events which are coming soon. All events that happening now
and before will not displayed. Next button can be clicked and the event details of next event will
be displayed.
46
In this page, the programme coordinator can add new event for the event management system.
47
3. All the attendance of the participants, feedback and rating towards the event that has over
is collected in paper form. This data is then being referred by the Head of school or
academic group leader while generating the report.
4. Event invitation is send to filtered group of students and staffs. I assume that the user is
required to select education group and display the participants of that group. Only 1
invitation can be sent at once to prevent error while sending information and prevent
spamming to all email. I assume some students are not invited or blacklisted on attending
the event.
5. Only events that are coming up soon are displayed in viewEvent page. Reminder of event
can be displayed in viewEvent page also. User can view what event is happening soon on
which date.
48
49
50
51