Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 31

OBJECT ORIENTED PROGRAMMING

BTEC HND IN COMPUTING & SYSTEMS DEVELOPMENT

PUBUDU KAVISHKA
ESOFT METRO COLLAGE – NUWARA ELIYA
pubudukavishka@gmail.com
Object Oriented Programming Sarasavi Information System

Table of Contents
1 Task 1................................................................................................................................5
1.1 What is Object Oriented Programming (OOP)..........................................................5
1.2 Purposes of OOP.......................................................................................................5
1.2.1 Code reuse and recycle.....................................................................................5
1.2.2 Design Benefits.................................................................................................5
1.2.3 Software Maintenance Ease..............................................................................5
1.2.4 Reliable.............................................................................................................6
1.2.5 Useful Concepts................................................................................................6
1.3 OOP Principles..........................................................................................................7
1.3.1 Encapsulation....................................................................................................7
1.3.2 Data Abstraction...............................................................................................8
1.3.3 Polymorphism...................................................................................................8
1.3.4 Inheritance........................................................................................................8
1.3.5 Objects..............................................................................................................9
1.3.6 Classes...............................................................................................................9
1.3.7 Destruction.......................................................................................................9
1.3.8 Garbage Collection............................................................................................9
2 Task 2..............................................................................................................................10
2.1 Classes of Sarasavi Information System..................................................................10
2.1.1 Class Library....................................................................................................10
2.1.2 Class Reader....................................................................................................11
2.1.3 Sub-Class Registered Member........................................................................12
2.1.4 Sub-Class Registered Visitor............................................................................13
2.1.5 Class Library Card............................................................................................14
2.1.6 Class Librarian.................................................................................................15
2.1.7 Class Book.......................................................................................................16
3 Task 3..............................................................................................................................17
3.1 Use case Diagram....................................................................................................17
3.2 Entity Relationship Diagram....................................................................................18
4 Task 5..............................................................................................................................19
4.1 Usage of Control Structures....................................................................................19
4.1.1 Startup Menu..................................................................................................19
4.1.2 Administrator Login.........................................................................................20

PUBUDU KAVISHKA 1
Object Oriented Programming Sarasavi Information System

5 Task 6..............................................................................................................................21
5.1 Integrated Development Environment (IDE)...........................................................21
5.1.1 What is an Integrated Development Environment (IDE)?...............................21
5.1.2 The IDE used in the development of the Sarasavi Information System...........22
5.1.3 Visual Studio 2013...........................................................................................22
References..............................................................................................................................26

PUBUDU KAVISHKA 2
Object Oriented Programming Sarasavi Information System

List of Figures
Figure 1: Startup Menu................................................................................................19
Figure 2: Administrator Login.....................................................................................20
Figure 3: Error List.......................................................................................................24
Figure 4: Drag & Drop Tools.......................................................................................24
Figure 5: Effective Code Editor...................................................................................24

PUBUDU KAVISHKA 3
Object Oriented Programming Sarasavi Information System

List of Tables
Table 1: Class Library..................................................................................................10
Table 2: Class Reader...................................................................................................11
Table 3: Sub-Class Registered Member.......................................................................12
Table 4: Sub-Class Registered Visitor.........................................................................13
Table 5: Class Library Card.........................................................................................14
Table 6: Class Librarian...............................................................................................15
Table 7: Class Book.....................................................................................................16

PUBUDU KAVISHKA 4
Object Oriented Programming Sarasavi Information System

1 Task 1
1.1 What is Object Oriented Programming (OOP)
Object oriented programming is a programming technique in which all the
components in the system are treated as objects. These objects can model real-world
objects like cars, people, buildings, etc. virtually. Most of the object oriented
programming languages are event driven programming languages.

[ CITATION IRo15 \l 1033 ]

1.2 Purposes of OOP


Object oriented Programming is a paradigm that is wide used in the professional
world of programming because of certain reasons, given below are some of those
reasons.

 Code reuse and recycling


 Design benefits
 Software maintenance ease
 Reliable
 Has many useful concepts

1.2.1 Code reuse and recycle


Objects created using object oriented programming can be easily reused in new
software projects. And the old code can be recycled into new projects.

1.2.2 Design Benefits


When designing a certain project object oriented programming force programmers to
extensively design the system which ultimately lead to better blueprint for the system.
When considering large projects object oriented programs are easier to code than non-
object oriented programs.

1.2.3 Software Maintenance Ease


Software should be maintained timely. Object oriented program’s code is much easier
to modify and maintain because of the structure of the code.

[ CITATION Ano15 \l 1033 ]

PUBUDU KAVISHKA 5
Object Oriented Programming Sarasavi Information System

1.2.4 Reliable
The software created using object oriented programming is more reliable because it
takes intense designing to make a system. This intense designing creates a more stable
and reliable software.

1.2.5 Useful Concepts


Object oriented programing pilgrim has many useful concepts such as Classes, objects
inheritance, modularity, polymorphism, and abstraction. This will be further more
described in between.

PUBUDU KAVISHKA 6
Object Oriented Programming Sarasavi Information System

1.3 OOP Principles


There are four major object oriented principles that will be discussed below, they are:

 Encapsulation
 Data Abstraction
 Polymorphism
 Inheritance
 Objects
 Classes
 Destruction
 Garbage Collection

1.3.1 Encapsulation
Encapsulation is hiding data from assessors and mutators by using some restrictions.
Encapsulation is access by modifiers.

1.3.1.1 Modifiers
Modifiers are keywords that modify the definition of a class. Given below are the
main types of modifiers.

 Private
o This is the default modifier
o This type of class can only be accessed by members of the certain
class.
o It cannot be accessed by other classes or members other than the
members of the certain class.
 Public
o This class can be accessed by any part of the program, it is public.
 Protected
o Access is limited to within the class definition and any class that
inherits from the class
 Internal
o Access is limited exclusively to classes defined within the current
project.

PUBUDU KAVISHKA 7
Object Oriented Programming Sarasavi Information System

 Protected Internal
o All members in current project and all members in derived class can
access the variables.

1.3.1.2 Who is an Assessor?


Assessor is a method that is used to ask the object about itself.

1.3.1.3 Who is a Mutator?


Mutator is the one who modify the properties of objects.

With the use of encapsulation we can make sure that when changing the object’s code
it would not affect other code in the program.

1.3.2 Data Abstraction


Abstraction means filtering out certain object’s properties and operations so that the
problem that needs information will get the right amount of information. This is the
best technique we can use where different types of problems require different amount
of information, even though those problems are in the same general area.

1.3.3 Polymorphism
Polymorphism simply means one object having different forms at different times.

In object oriented programming polymorphism refers to that an operation acts


differently according the nature of the object.

Main operations of polymorphism are:

o Function overloading
o Operator overloading
o Method overloading

1.3.4 Inheritance
A class is a category of objects. An object is an instance of a class. As an instance of a
class, an object that has all the characteristics on its class. This is inheritance. The
main types of inheritance are:

 Public Inheritance

PUBUDU KAVISHKA 8
Object Oriented Programming Sarasavi Information System

 Private Inheritance
 Protected Inheritance

[ CITATION Ray05 \l 1033 ]

1.3.5 Objects
An object is an abstract representation of a thing in the physical world. It can also be
said that an object is any item that can be individually selected and manipulated. This
can be real world objects and intangible objects. In object oriented programming
everything in the code is treated as an object. Objects are unique instances of classes
with attributes and behaviors. For example:

 A Reader object can have many attributes like:


o Name
o Age
o NIC Number
 It can also have certain behaviors like:
o Inquiry
o Rent a book
o Return a book

[ CITATION Eso \l 1033 ] [ CITATION Ano16 \l 1033 ]

1.3.6 Classes
A class can be simply called as a template for a certain amount of objects. A class
contain all the properties of a group of objects that the class is related to. A class can
have many subclasses that can inherit all or some of the characteristics and
properties of the main class. A class is a blueprint for objects.

[ CITATION Eso \l 1033 ] [ CITATION Mar05 \l 1033 ]

1.3.7 Destruction
This method is used to destroy and cleanup objects when they are not needed.

PUBUDU KAVISHKA 9
Object Oriented Programming Sarasavi Information System

1.3.8 Garbage Collection


It is a runtime process which clears memory which was occupied by objects that are
no longer useful.

2 Task 2
2.1 Classes of Sarasavi Information System
2.1.1 Class Library

Library

- Name: String

+ Issue Books()

Table 1: Class Library

Class Name – Library

Attribute(s)

o Name

Method(s)

o Issue_Books()

PUBUDU KAVISHKA 10
Object Oriented Programming Sarasavi Information System

2.1.2 Class Reader

Reader

#User_ID: Integer
- Name: String
- Gender: String
- Number of Books : Integer
- Address: Alphanumeric
- NIC Number: Alphanumeric
- Type: String
+ Read()

Table 2: Class Reader

Name – Reader

Attributes

o User_ID
o Name
o Gender
o Number of Books
o Address
o NIC Number
o Type

Method

o Read()

This class also has two sub-classes, they are: Registered Members

Registered Visitors

PUBUDU KAVISHKA 11
Object Oriented Programming Sarasavi Information System

2.1.3 Sub-Class Registered Member

Registered Member

#User_ID: Integer
- Name: String
- Gender: String
- Number of Books : Integer
- Address: Alphanumeric
- NIC Number: Alphanumeric
+ Refer_Books()
+ Borrow_Books()
Table 3: Sub-Class Registered Member

Name – Registered Member

Attributes

o User_ID
o Name
o Gender
o Number of Books
o Address
o NIC Number

Method

o Refer_Books()
o Borrow_Books()

PUBUDU KAVISHKA 12
Object Oriented Programming Sarasavi Information System

2.1.4 Sub-Class Registered Visitor

Registered Visitor

#User_ID: Integer
- Name: String
- Gender: String
- Address: Alphanumeric
- NIC Number: Alphanumeric
+ Refer_Books()

Table 4: Sub-Class Registered Visitor

Name – Registered Visitor

Attributes

o User_ID
o Name
o Gender
o Address
o NIC Number
Method

o Refer_Books()

PUBUDU KAVISHKA 13
Object Oriented Programming Sarasavi Information System

2.1.5 Class Library Card

Library Card

#User_ID: Integer
- Name: String
- Expiry_Date: Date
+ Refer_Books()
+ Borrow_Books()
Table 5: Class Library Card

Name – Library Card

Attributes
o User_ID
o Name
o Expiry_Date
Method
o Refer_Books()
o Borrow_Books()

PUBUDU KAVISHKA 14
Object Oriented Programming Sarasavi Information System

2.1.6 Class Librarian

Librarian

#Librarian_ID: Integer
- Name: String

+ Update_Details()

Table 6: Class Librarian

Name – Librarian

Attributes

o Librarian _ID
o Name

Method

o Update_Details()

PUBUDU KAVISHKA 15
Object Oriented Programming Sarasavi Information System

2.1.7 Class Book

Book

#Book_ID: Alphanumeric
- Title: String
- ISBN: Alphanumeric
- Publisher: String
- Type: String
- Quantity: Integer
+ Issue()

Table 7: Class Book

Name – Book

Attributes

o Book_ID
o Title
o ISBN
o Publisher
o Type
o Quantity

Method

o Issue()

PUBUDU KAVISHKA 16
Object Oriented Programming Sarasavi Information System

3 Task 3
3.1 Use case Diagram

PUBUDU KAVISHKA 17
Object Oriented Programming Sarasavi Information System

3.2 Entity Relationship Diagram

3.3

PUBUDU KAVISHKA 18
Object Oriented Programming Sarasavi Information System

4 Task 5
4.1 Usage of Control Structures
4.1.1 Startup Menu

Figure 1: Startup Menu

 This control structure is used to check whether the user is an Administrator or


a Reader and to send the relevant user to the relevant form.

PUBUDU KAVISHKA 19
Object Oriented Programming Sarasavi Information System

4.1.2 Administrator Login

Figure 2: Administrator Login

 This control structure checks whether the login credentials are corrects and
lets the administrator to login to the system.

PUBUDU KAVISHKA 20
Object Oriented Programming Sarasavi Information System

4.1.3 Book Search

Figure 3: Book Search

This control structure checks whether the Boolean values title and publisher are true
and executes the code under the relevant statement.

PUBUDU KAVISHKA 21
Object Oriented Programming Sarasavi Information System

Task 6

4.2 Integrated Development Environment (IDE)


4.2.1 What is an Integrated Development Environment (IDE)?
An IDE is an acronym that stands for Integrated Development Environment. An IDE
is used to make computer programs. It is a package that consists of several
programming tools which are integrated together as an application program. An IDE
consists of several tools such as:

o Text Editor
o Debugger
o Compiler
o Graphical User Interface (GUI) designer

An IDE can be either a standalone program or an application program.

Given below are examples of some popular IDEs:

 Visual Studio
 Pycharm
 Netbeans
 Brackets
 PHPStorm

PUBUDU KAVISHKA 22
Object Oriented Programming Sarasavi Information System

4.2.2 The IDE used in the development of the Sarasavi Information System
The IDE used in the development of the Sarasavi Library System is Visual Studio
2013 Ultimate.

4.2.2.1 Reasons for using Visual Studio


 Easy to develop GUI applications
 More effective and efficient
 Supports a wide range of Databases
 Reliable

4.2.3 Visual Studio 2013


Visual Studio is an Integrated Development Environment (IDE) developed and
released by Microsoft Corporation. It was first released in 1995 and it was named
Visual Studio 4.0. It supports in development of all .net programming languages,
such as:

 C
 C++
 C#
 VB.net
 ASP.net
 Etc.

It is used in the development of Microsoft Windows based applications and it


comprise of many features.
4.2.3.1 Features of Visual Studio
Microsoft Visual Studio has many features that ease the work of the programmer,
some of the main features are listed below.

 Code Editor
 Debugger
 Designer

PUBUDU KAVISHKA 23
Object Oriented Programming Sarasavi Information System

4.2.3.1.1 Code Editor


A code editor is where the programmer can edit the source code of the program. The
code editor that Visual Studio has encompass a technology known as IntelliSense, this
technology allow Visual Studio to complete the code automatically which greatly help
in easing the work of the developer.

4.2.3.1.2 Debugger
A debugger is an application which helps in debugging the program. The default
debugger that comes with Visual Studio supports all .net programming languages and
it works as a Source-level debugger as well as a Machine-level debugger. It also can
be attached to processes and debug them while they run.

4.2.3.1.3 Designer
A designer is the component of the IDE which allows the developer to develop the
Graphical User Interface (GUI) of the system. Visual Studio 2013 has a very powerful
designer which host many unique features, like:

 Windows Forms Designer


 WPF
 Web Designer/Developer

The most noteworthy feature of the designer is the WPS which allows the developer
to drag and drop various tools such as Textboxes, Buttons, etc. on to the developing
windows form, this feature greatly improves the ease the work of the developer.

Other than the above given features this IDE has an onboard event and error handler
which uses a user friendly interface that makes the troubleshooting process easier.

[ CITATION Mic16 \l 1033 ]

PUBUDU KAVISHKA 24
Object Oriented Programming Sarasavi Information System

4.2.3.1.4 Screenshots

Figure 4: Error List

Figure 5: Drag & Drop Tools

Figure 6: Effective Code Editor

PUBUDU KAVISHKA 25
Object Oriented Programming Sarasavi Information System

5 Task 9
5.1 Questionaries’
1) Are all the requirements satisfied using the system?
Yes No
2) Do you feel comfortable with the user interface?
Yes No
3) Do you want this system to be more user friendly?
Yes No
4) Do you think this system is practical?

Yes No

5) Do you feel secure with using this system?


Yes No
6) Does the system load quickly?
Yes No
7) How would you rate the performance of the system?
Low Medium High
8) What are your suggestions to improve this system?
…………………………………………………………………………………
…………………………………………………………………………………
………………………………………………………………………………....
9) Do you have any suggestions about adding new features to this system?
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………
10) What were the features of this system which compromised its user
friendliness?
…………………………………………………………………………………
…………………………………………………………………………………
…………………………………………………………………………………

PUBUDU KAVISHKA 26
Object Oriented Programming Sarasavi Information System

PUBUDU KAVISHKA 27
Object Oriented Programming Sarasavi Information System

5.2 Feedback
Name Q.1 Q.2 Q.3 Q.4 Q.5 Q.6 Q.7
Miss. Melisha Fernando Yes Yes No Yes Yes Yes High

Mr. Kabilan Viswanathan Yes Yes Yes Yes Yes Yes Medium

Mr. Jude Perera

Mr. Kavindha Ranasinghe

Mrs. Kishokanth Kumar


Table 8: Feedback 1 - 7

Name Q.8
Miss. Melisha Fernando Make the system a bit more user friendly and
Secure.

Mr. Kabilan Viswanathan

Mr. Jude Perera

Mr. Kavindha Ranasinghe

Mrs. Kishokanth Kumar

Table 9: Feedback 8

PUBUDU KAVISHKA 28
Object Oriented Programming Sarasavi Information System

Name Q.9
Miss. Melisha Fernando None

Mr. Kabilan Viswanathan

Mr. Jude Perera

Mr. Kavindha Ranasinghe

Mrs. Kishokanth Kumar

Table 10: Feedback 9

Name Q.10
Miss. Melisha Fernando Splash Screen

Mr. Kabilan Viswanathan

Mr. Jude Perera

Mr. Kavindha Ranasinghe

Mrs. Kishokanth Kumar

Table 11: Feedback 10

5.2.1

PUBUDU KAVISHKA 29
Object Oriented Programming Sarasavi Information System

References
Anonymous, n.d. Computer Systems. [Online]
Available at: www.cs.drexel.edu/~introcs/Fa12/notes/06.1OOP/Advantages.html
[Accessed 2015].
Anonymous, n.d. Webopedia. [Online]
Available at: http://www.webopedia.com/TERM/O/object.html
[Accessed 2016].
Esoft, n.d. Object Oriented Programming with .net. s.l.:Esoft.
I, R., n.d. Quora. [Online]
Available at: www.quora.com
[Accessed 2015].
Lewallen, R., 2005. Code Better. [Online]
Available at: codebetter.com/raymondlewallen/2005/07/19/4-major-principles-of-
object-oriented-programming/
[Accessed 2015].
Microsoft, n.d. Introducing Visual Studio. [Online]
Available at: http://msdn.microsoft.com/en-us/library/fx6bk1f4(v=vs.90).aspx
[Accessed 2016].
Rouse, M., 2005. WhatIs. [Online]
Available at: http://whatis.techtarget.com/definition/class
[Accessed 2016].

PUBUDU KAVISHKA 30

You might also like