Escolar Documentos
Profissional Documentos
Cultura Documentos
Contents
1. Introduction...............................................................................................................................3
1.1 Project Overview.........................................................................................................................3
1.2 Objective of the project................................................................................................................3
1.3 List of presumed assumptions......................................................................................................4
1.4 Scope of the project.....................................................................................................................4
2. Description and justification of the design of the implementation codes...................................5
2.1 System Features...........................................................................................................................5
2.2 User Privileges.............................................................................................................................5
2.3 Design (Logical Design) and Justifications.................................................................................7
2.3.1 Use Case diagram.....................................................................................................................7
2.3.2 Hierarchical chart for proposed system.....................................................................................8
2.3.3 Class Diagram.........................................................................................................................11
3. Description and Justification of Implementation codes in terms of the OOP Concept.............13
3.1 Class and Objects.......................................................................................................................13
3.2 Data Abstraction and Encapsulation..........................................................................................15
3.3 Inheritance.................................................................................................................................17
3.4 Polymorphism............................................................................................................................19
3.4.1 Operator overloading and method overloading.......................................................................19
3.4.2 Method Overloading...............................................................................................................19
3.4.3 Parametric overloading and generacity...................................................................................21
4. Description and justification of the validation codes applied into the implementation codes. .22
4.1 Validations for the menu selections...........................................................................................22
4.2 Validation for file operations.....................................................................................................23
5. Testing and Test Plans.............................................................................................................24
5.1 Features to be tested...................................................................................................................24
5.2 Test plan for Login Module.......................................................................................................24
5.3 Test plan for Main Menu Selection............................................................................................25
5.4 Test plan for Academic Staff Management................................................................................26
5.5 Test plan for Module Management – Assign Lecturer..............................................................27
5.6 Test plan for Marks Management – View Marks.......................................................................27
5.7 Test plan for File Handling........................................................................................................28
6. Critical Evaluation...................................................................................................................29
7. Reference.................................................................................................................................30
Reference
1
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
1.
2
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
List of Tables
Table 2.1 User Privileges ……………………………………………………………………..6
Table 2.2 File Structure ……………………………………………………………………….9
Table 5.1 Test plan for Login Module ………………………………………………………24
Table 5.2 Test plan for Menu Module ……………………………………………………….24
Table 5.3 Test plan for Academic Staff Menu ………………………………………………25
Table 5.4 Test plan for Academic Staff Module …………………………………………….26
Table 5.5 Test plan for Module Management ……………………………………………….26
Table 5.6 Test plan for Marks management …………………………………………………26
Table 5.7 Test plan for File Handling ……………………………………………………….28
3
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
List of Figures
Figure 2.1 Case diagram
……………………………………………………………………………………………………………
………7
Figure 2.2 Privileges diagram
……………………………………………………………………………………………………………
.8
Figure 2.3 Class Diagram
……………………………………………………………………………………………………………
……10
Figure 3.1 Inheritance
……………………………………………………………………………………………………………
………..16
4
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
List of Abbreviations
OO Object Oriented
5
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
1. Introduction
Manage and keep data of an organisation is one of the most important task. Different
organisations or individuals use different approaches to fulfil that. Security of the data,
efficiency of the system and reliability of the system are the most essential and important
factors of an information management system. Because of it, it is possible to expand,
processing and handling capacity of organisation.
Handling data of an organisation using manual system can be risk sensitive data of the
organisation because that there can be a leak of the information and it is very difficult to
identify where is the system compromise .Also reliability and efficacy of the system depend
on it is human resources. Apart form that backup or clone data and keep them safely can be
difficult because of its manual format.
To prevent and minimize above risks and gain advantage of technology it is suggest to use
computerized information management system. SMS (Student Management system) is
windows based console application which allows manage, store and edit complete personal
records and examinations results of each student in a university.
As required by assignment, Object Oriented Concept and OO designing pattern have applied
with this solution. Apart form that, files use as data storing media and following features have
included with the final application
• Advanced login with authenticate system for selected user
categories
• User management
• Module management
• Advanced search facility
• Marks management
Microsoft Visual Studio Team System 2008 and Dot net framework 3.5 have used as main
developing and testing platform of this application. Microsoft Visual C++ 6.0 has used as a
secondary developing and testing tools. UML has used as modelling method of this
application.
The main objective of the project is providing a complete solution for handle records of
students in a university by using OOP concept and OOP patterns. Main objective can be
dividing into further as shown in below.
• Provide essential security and privileges to data of the system and its
users
• Provide capability to handle records of the system
• Provide reporting capability up to some extends
6
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
To make more meaningful, feasible and easy of design and develop, following assumptions
have made and narrow the scope of the application.
The scope of the project is developing win32 console application which provides record
handling capability of a university. System will enable to system administrators,
Administrative staff, academic staff and students to view, enter, modify and delete records
based on given privileges.
7
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
1. User login
2. User management
• User registration
• User modification
• User deletion
1. Module Management
• Module registration
• Module modifications
• Module deletions
• Assign lecturers
• Assign student for modules
1. Marks
• Entering marks
• Modifying marks
1. Search
Privileges on above features can be varying based on the user type .The following diagram
shows users and their privileges
Marks
Add (Related
)
View (Related)
Modify (Related
)
Search (Related) (Related (Related)
)
9
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
UML (Unified Modelling Language) has been used as analysing and design tool of this
project. This artefact has developed based on object oriented concept.
System
«inherits»
«inherits»
AdminstrativeStaff Member
Login
Student AcadamicStaff Member Admin
Modify Module
System Admin
Modify Users
Student
Modify Marks
Adminstrative Staff Member
View User
View Marks
System Admin
View Module
Student
The reason for having four user type inherited form one user is, it is possible to identify some
common characteristics between 4 actors. So it is make more sense to generalize user actor in
to other 4 user types.
As mentioned before system admin has full privileges and other users have limited privileges.
In the proposed system different privileges have implemented by restricting menu access for
different user levels.
The following table shows attributes of the user types, modules, enrolments and marks
country: String
telephone: String
mob: String
email: String
Admin Ac A Student
ad d
em m
ic in
St ist
aff ra
M ti
em ve
be St
r af
f
M
e
m
be
r
Dateretired String Batch String
12
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
User
#userid : string
#statues : string
#userpassword : string
#fname : string
#mname : string
#lname : string
#nidno : string
#gender : string
#dateofbirth : string
#datejoined : string
#nationality : string
#addressLine 1 : string
#addressLine 2 : string
#city : string
#postalno : string
#country : string
#telephone : string
#telephone : string
#mob : string
#email : string
+login() : void
+logout () : void
+search () : void
*
Student +genarateID() : string AdministrativeStaff
-batch : string +view() : void -dateHired : string
-imodule : Module +loadMainMenu () : void -file : FileHandler
+ShowCommandConsole () : void -controller : UserHandler
+viewMarks (in Parameter 1) : void
+viewModule (in Parameter 1 : string) : void +viewMarks (in studentid : string , in moduleid : string , in attemp : int) : void
+enroll (in id : int, in imodule : Module ) : void +viewModule (in moduleid : string ) : void
*
*
* * -End3
Admin
-controller : UserHandler
-file : FileHandler
-dsteRetired : string
+RegisterNew (in Parameter 1 : Student ) : void
+RegisterNew (in Parameter 1 : AdministrativeStaff ) : void
*
+RegisterNew (in Parameter 1 : AcadamicStaff ) : void
+viewUser (in Parameter 1 : Student, in Id : int) : void
Enrolment +viewUser (in Parameter 1 : AcadamicStaff , in Id : int ) : void
+viewUser (in Parameter 1 : AdministrativeStaff , in Id : int) : void
-ID : string +deleteUser (in Parameter 1 : Student , in Id : int) : void
-ModuleID : string +deleteUser (in Parameter 1 : AcadamicStaff , in Id : int) : void
-StudentID : string +deleteUser (in Parameter 1 : AdministrativeStaff , in Id : int ) : void
-BatchCode : string +editUser (in Parameter 1 : Student, in Id : int ) : void
+GenarateID () : string +editUser (in Parameter 1 : AcadamicStaff , in Id : int ) : void
+editUser (in Parameter 1 : AdministrativeStaff , in Id : int ) : void
* +viewModule (in id : int, in imodule : Module ) : void
+viewMarks (in id : int) : void
+editMarks (in id : int) : void
+editModule (in id : int, in iModule : Module ) : void
+deleteMarks (in id : int) : void
+deleteModule (in id : int , in iModule : Module ) : void
+addMarks () : void
+addModule () : void
* * *
Module
-modID : string
-code : string
-cordinator : string
-duration : int
-name : string
-validility : string
+view () : void
+genarateID () : string
*
*
* * -End4
*
UserHandler
*
*
+registerNew (in iobject : AdministrativeStaff ) : void
* * +registerNew (in iobject : Student) : void FileHandler
* +registerNew (in iobject : AcadamicStaff ) : void
* +delete (in id : int , in istudent : Student ) : void +view (in id : int, in istudent : Student ) : void
MarkModuleHandler +delete (in id : int , in iobject : AdministrativeStaff ) : void +view (in id : int, in iobject : AdministrativeStaff ) : void
+delete (in id : int , in iobject : AcadamicStaff ) : void +view (in id : int, in iobject : AcadamicStaff ) : void
+studentSearch (in searchCatogory : char ) +view (in id : int, in iobject : Module ) : void
+view (in id : string , in iobject : Module ) : void +AcadamicSearch (in searchCatogory : char ) +view (in id : int, in iobject : Marks) : void
+enterNew (in iobject : Module ) : void +AdminSeach () +write(in id : int, in iobject : Marks) : void
+edit(in id : int , in iobject : Module ) : void +ModuleSearch () +write(in id : int, in iobject : Module ) : void
+delete (in id : string, in iobject : Module ) : void +MarkSearch () +write(in id : int, in iobject : AcadamicStaff ) : void
+enterNew (in iobject : Marks) : void +write(in id : int, in iobject : AdministrativeStaff ) : void
+view (in id : string , in modid : string, in userid : string, in atemp : int) : void * +write(in id : int, in istudent : Student) : void
+edit(in id : string , in modid : string, in userid : string, in atemp : int) : void +rewrite(in id : int, in istudent : Student ) : void
+delete (in id : string, in *modid : string , in userid : string , in atemp : int) : void * * +rewrite(in id : int, in iobject : AdministrativeStaff ) : void
*
+rewrite(in id : int, in iobject : AcadamicStaff ) : void
+rewrite(in id : int, in iobject : Module ) : void
* AcadamicStaff
* +rewrite(in id : int, in iobject : Marks ) : void
-dateHired : string +delete (in id : int, in istudent : Student ) : void
-file : FileHandler +delete (in id : int, in iobject : AdministrativeStaff ) : void
Marks -ui : Grapix +delete (in id : int, in iobject : AcadamicStaff ) : void
-userid : string -controller : UserHandler +delete (in id : int, in iobject : Module ) : void
-moduleid : string +viewMarks (in studentid : string, in moduleid : string , in attemp : int) : void +delete (in id : int, in iobject : Marks) : void
-atempt : int +viewModule (in moduleid : string ) : void +getFileSize (in id : int , in istudent : Student ) : double
-mark : double +AddMarks (in studentid : string , in moduleid : string , in attemp : int) : void +getFileSize (in id : int , in iobject : AdministrativeStaff ) : double
+setMark (in imoduleid : string, in iattempt : int, in imark : double ) : void +EditMarks (in studentid : string , in moduleid : string , in attemp : int) : void +getFileSize (in id : int , in iobject : AcadamicStaff ) : double
+getMarks () : double +getFileSize (in id : int , in iobject : Module ) : double
+getFileSize (in id : int , in iobject : Marks) : double
13
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
Student, academic staff, administrative staff and admin inherited form the user class which
have common characteristics of all 4 other users. “Userhandler” class manages above
mentioned four class’s interconnectivity with each others and “MarkModuleHandler” class
which has connected with module and marks classes performs same duty of “Userhandler”
class. The Student, “AcademicStaff”, “AdministrativeStaff” and admin classes access marks
and module via “MarkModuleHandler” .
Enrolment class keeps track on connections between module and student classes. By using
Enrolment class it allows to manage and keep track on students’ modules. Also because of
using enrolment class it allows to keep details of all existing modules which have followed
by a student in a given time duration and reduce unnecessary communications between
classes
Although there are lot of drawback of using file as a store media because of project
requirements, the data of the system is store in files which handle by “FileHandler” class. It
uses binary format to store. Above mentioned table 2.2 demonstrate attributes and type of the
data which store in the files. The reason for using binary format to encrypt the data because
of that it is possible to protect data from unauthorized access.
14
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
Because of that it make easy to designer to map logical design with the real world objects and
understand the issues and correct them. Class is the basic atomic unit of the OOP.
Class can be identified as most imported entity of OOP. In simple way class is the blueprint
of an object which mean it has all characteristics and properties which should have on
particular object. As mentioned by Microsoft Developer Network (2009) class describe the
structure of an object
This solution contains 11 different classes which have allocated for different purposes.
This classes’ method can be implement separately before the initialization / creating an
object.
User::void login(){
// Implementation of codes}
15
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
Like this all class have declared except interface and abstract classes of the solution. When it
required to access method or data member of a class it creates an object and access them
using member access operator.
The following code shows how to create an object and access the data member or methods of
it
User *iuser; // create user pointer, Assumed that user is a base class and admin in
// derived class of user
Admin iadmin;
iuser=&iadmin;//Point iuser to iadmin object
iuser->login();//call login method of iadmin (Assumend login() is a virtual function)
Ideally using classes allow programmer to reuse classes as a blueprint and make objects in
different location of the application. And also it makes easy to programmer to manage code
and use them effectively. Because of using classes and objects it takes less time to trouble
shooting the application.
16
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
Encapsulation and Abstraction are going together words in Object Oriented programming.
Abstraction is a one of the most important concept in OOP.
In this solution there is one abstract class which can identified as an interface class. The
reason for making “User” class interface is, Student,”AcadamicStaff”,”AdministrativeStaff”
and Admin classes have very common characteristics which can be identified as essential
and important details of the four classes because of that it allows to share common features
between four classes.
The following codes which have extracted form the project shows the how abstract classes
have implemented
Class “User” is a pure virtual class which mean it is an “interface” class, which have only
declarations of the methods but not implemented. Because of that it is not possible to create
an object from “User” class.
By creating inherited classes form the “User class” it is possible to access data members and
implement functions of the “User” and since it is using virtual functions it is possible to
access inherited classes method via a pointer of “User” Which can make code more dynamic
Following codes demonstrate how to access inherited classes’ methods via base class
methods. Class “Admin” has inherited form class “User”.
17
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
User *iuser; // create user pointer, Assumed that user is a base class and admin in
// derived class of user
Admin iadmin;
iuser=&iadmin;//Point iuser to iadmin object
iuser->login();//call login method of iadmin (Assumend login() is a virtual function)
In this solution all data members of the classes access through functions which make data
members more secure by limiting access to outer world. Because of that the data of the class
can not change by using any other class for the reason that all data members are protected
and only accessible for method of the own classes, inherited classes and friend class and
functions.
3.3 Inheritance
As mentioned by Morin (2002) “Inheritance is the concept that when a class of object is
defined, any subclass that is defined can inherit the definitions of one or more general
classes.” Which mean derived class has same characteristics of base class. The idea of
inheritance is “Reusability” because derived class can access all data members (which
allowed to inherit by putting access specifiers, protected or public) and functions of the base
class. If it required, they can override it without changing base class attributes. Inheritance
can be categorized as multiple inheritance, single inheritance, hierarchical inheritance and
multilevel inheritance
User
Student Admin
AcadamicStaff AdministrativeStaff
Base Class
Derived Class
By using inheritance it is possible to implement different type of users which inherited from
“User” class by doing minor modification to main class. It is added advantage of using OOP
concept in this project.
20
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
3.4 Polymorphism
Polymorphism (from the Greek, meaning "many forms") is the quality that allows one name
to be used for two or more related but technically different purposes.(Schildt,1998).There are
3 main categories of polymorphism
Operator Overloading
By using operator overloading it is allows to code more meaningful function and apply them
in effectively. Also it improves “reusability” of the code. Type casting can also take as a
operator overloading.
There are few operators overloading in this solution to improve application coders experience
more easily and manage the codes in efficient way. The following codes show applications of
an operator overloading in this application.
21
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
It is appears to be both method are same but they access different files and use different
classes and different type of objects.
22
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
There are two way of applying polymorphism via parameters. Parametric overloading gives
ability to define number of methods in same class by changing there parameters and return
type of it.
//Continue …………………….
Genetacity or parametric overloading allows to creates generic methods which are applicable
to range of objects using “Template” concept this can be achieve.
During the development of the solution different class used this concept to reduce
unnecessary codes and make more effective application.
// Taken in Admin.h
template<class Tclass>
void registerNew(Tclass &iobject)
{
controller.registerNew(iobject);// This is the methods
for create new user)
}
Using template functions reduce unnessory duplication of the coding.To register all four user
of the system takes four function but using templates it can be done only using one single
function.
23
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
It required validations to reduce unnecessary logical errors of the application. Due to limited
time frame only few validations were implemented.
Each and every selection menu of the application only accepts the limited character input
including both upper and lower case. If user input invalid character it is prompt an error
message and allow user to navigate away based on the menu and location of the application.
24
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
3.
25
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
Since all system use same source to call function it was checked all functions logged as an
admin except login. The login module checked by logged as all users.
• Login
• Main selection
• Student Management
• Academic Staff Management
• Administrative Staff Management
• Mark Module
• Module Management
• Search
Logging as a admin
parameter
Login – wrong Display error message
parameter
Admin Menu
Since all user menus and functionalities same and call in same source it is use “Academic
Staff Management “module to tested other modules. But additional features of the other
modules which are not relevant to academic staff management module tested separately.
27
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
prompt
Accept confirmation Update record and show navigation
message option
Cancel confirmation Show navigation
Assign Lecturer
Enter correct search Prompt message that it is available ,
parameters in the prompt user to assign lecturer
prompt
Enter required details ask user confirmation
to the fields
Enter incorrect search Prompt message that record is not
parameters in the available and allow user to navigate
prompt
Accept confirmation Update record and show navigation
message option
Cancel confirmation Show navigation
Table 5.5 Test plan for Module Management
Assign Lecturer
Enter correct search Prompt message that it is available ,
parameters in the prompt user to assign lecturer
prompt
Enter required details ask user confirmation
to the fields
Enter incorrect search Prompt message that record is not
parameters in the available and allow user to navigate
prompt
Accept confirmation Update record and show navigation
message option
Cancel confirmation Show navigation
Table 5.6 Test plan for Marks management
All menus of the application accept both upper and lower case letters as selections. When
user required to access not implemented or not required feature of the application it shows
error message and prompt user to navigate away.
Although some of file read write operations covered in previous test plans and because of all
operations used same source file and call them in different locations of the application, file
read write operation checked manually in selected cases. To check that add, view and
modification features were used.
29
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
30
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
1. Critical Evaluation
OOP is the latest programming trend in the world. As a software developer, engineer it is
necessary to absorb correct techniques and technology to keep in field.”Further Programming
Concept in C++” module gives a golden opportunity to polish knowledge and experience of a
student.
During the project life cycle, object oriented concept, UML and application of OOP concept
have practised. Since this is an individual project a variation of SDLC used to keep track on
the project works but with less documentation.
1. Object oriented concept based on mapping real word objects to computer code
2. By using OOP concept , designers and developers find that code
management(maintain and modifying) is easy
3. OOP reduce unnecessary duplication of the code and improve reusability of the
application
4. Using OOP, it is possible to implement code library which is integrated all necessary
components, class and abstract classes where implementation details are not allowed
to access to other. Because of this feature it is possible to provide secure development
environment without giving direct access to base codes.
5. Required more time to initial design time and mapping with the real world entity can
be confusing, cause to serious logical errors and always not possible to perform.
By finding above facts, although there are some disadvantages it is determined that using
OOP concept cause to reduce lot of problems and increase effectiveness of the code.
31
Asia Pacific Institute of Information Technology
Sri Lanka
Further Programming Concepts in C++ (CE00314-2-FPCOP)
1. Reference
Balagurusamy, E.(2008) Object oriented program with c++. New Delhi: Tata McGraw-Hill.
Schildt. (1998) Teach Your self C++ [online]. New Delhi: Tata McGraw-Hill. Available
from:http://books.google.com/books?
id=8uszuvNpFy0C&pg=PA5&dq=he+quality+that+allows+one+name+to+be+used+for+two
+or+more+related+but+technically+different+purposes.&ei=wJa0SpzAAqaSkQSaub37Dw#
v=onepage&q=&f=false.
[Accessed 5 May 2004].
Sun Developer Network Site. (2009) Understanding Instance and Class Members [online].
Available from: http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html.
[Accessed 25 August 2009].
Microsoft Developer Network. (2009) Classes: Blueprints for Objects [online]. Available
from: http://msdn.microsoft.com/en-us/library/ee5edha0.aspx.[Accessed 25 August 2009].
32
Asia Pacific Institute of Information Technology
Sri Lanka