Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction..........................................................................................................................3
Use Case Diagram...............................................................................................................4
Sequence Diagram...............................................................................................................5
Inheritance...........................................................................................................................6
Encapsulation.......................................................................................................................7
Limitation............................................................................................................................8
Object Oriented Programming Concept..............................................................................9
Comparison of Object-Oriented and Non Object-Oriented...............................................11
Inheritance.....................................................................................................................12
Polymorphism................................................................................................................13
Encapsulation.................................................................................................................14
Advantages of Object Oriented Programming Concept....................................................15
Why you need OO in this assignment?..............................................................................16
What is UML Diagram......................................................................................................16
References..........................................................................................................................17
Introduction
In this assignment, the researcher is to be designed an application to maintain student
exam details for a university. The users should be able to enter, search, edit and view
personnel information of students and also enter, view and edit exam marks of the
students based on different access priority. This application will be used by the
administrators, lecturers, administrative staff and students.
In this case, this system will provide 4 different users such as administrators, lecturers,
administrative staff and students to login to the management system. For each user, they
have different accessibility. For instance, the administrator has the highest access priority
which enables him or her to perform all the functionalities that exist in the application.
He or she is able to register new users to the system and able to add, delete, edit search
and update all the records including student records, staff records, lecturer records and
module records. The lecturers in charge of a module have the right to enter, view, delete
and edit marks for the given module. They are able to view and search student and
module information as well. Whereas, the students are only allow to view their
examination report and module details.
Besides that, the author will need to auto generate ID for each and every users in the
records and the numbers cannot be repeated.
Sequence Diagram
Diagram above shows the sequence diagram of adding records to the system using
database.
Diagram above shows the sequence diagram of and search records including student,
lecturer, and administrator staffs record.
Inheritance
In this case, the author had implemented the class with the use of object oriented
programming concept feature which is inheritance. Diagram above shows the LectPanel
Class will inherit the class db which will allow the subclass to connect the database.
Encapsulation
The author had also included the feature of encapsulation in order to provide data hiding.
The purpose of encapsulation allows developer to hides the internal implementation
detail of an object from its external views. This is to prevent codes in SearchStu Class
and ViewRec class being accessed by other class.
Limitation
Data Hiding
Data Hiding in Object-oriented programming concepts provide the developers to hide the
variables in the function so it will not be accessed by the any part of the program. The
developer then calls it method without revealing the stored data. (Andrew Hardwick,
2001)
Automatic Initialization
A class can create constructors with the default value where the field of a class will be
automatically assigned to the table shown below. Every field of a primitive type is
initialized to a default value of false or zero. All fields of reference type are, by default,
initialized to null. These default values are guaranteed by Java. If the default value of a
field is appropriate, you can simply rely on it without explicitly initializing the field.
(OReilly, 2001)
Overloading
The method of overloading is refer to using different functions but have the same name
and they will be differentiated by the number and type of arguments passed into the
method. (Baseline Inc, 2003)
Derived Classes
This is one of the most vital techniques that allow developers to share variables and
methods from the other class to set up a new class. The derived class could have extended
it features from the existing class which is named as parent class. (Andrew Hardwick,
2001)
and data
Not every procedural language able to create a GUI application.
OO
Inheritance
The word inherit means the using something that already exists. In object-oriented
programming concept, inheritance is one of the important features that allow a class
to use the properties and methods of another class while adding its own functionality. An
example of where this could be useful is with an employee records system. You could
create a generic employee class with states and actions that are common to all
employees (John W.M.Russell, 2011). In this feature, there must be a parent class which
has the method or object which enable other class to derive to form into new class. The
derived class is called as child class or the subclass or we can say the extended class and
the class from which we are deriving the subclass is called the base class or the parent
class (RoseIndia, 2007). The keyword extend will be used in the new class in order to
retrieve data from the parent class. In object-oriented programming concept, a class can
only has a super class while super class could have unlimited number of subclasses. The
author will explain inheritance in diagrams below. For example, Class Z is the Vehicle
Registration Form that has all the variables and behavior of a vehicle. Class A for car
registration while Class B for motorcycle registration and Class C for lorry registration.
In this case, Class A, B and C do not need to declare the variables and method that had
been declared in Class Z if Class A, B and C have extended the Class Z.
Class Z
Class A
Class B
Class C
Polymorphism
Polymorphism is the capability of an action or method to do different things
based on the object that is acting upon(John W.M. Russell, 2011). It is the ability of
appear in many forms that allow changing or modifies the method in the subclass that
extended from the parent class. Any java object that can pass more than on IS-A test is
considered to be polymorphic. In java, all java objects are polymorphic since any object
will pass the IS-A test for their own type and for the class object. It is important to know
that only possible way to access an object is through a reference variable. A reference
variable can be of only one type. Once declared the type of reference variable cannot be
changed. The reference variable can refer to any of its declared type or any subtype of its
declared type. A reference variable can be declared as a class or interface
type.(TutorialsPoint, 2012).
This allows several methods of different subclasses could be treated as objects of
a single super class, while automatically selecting the proper methods to apply to a
particular object based on the subclass it belongs to. There are 3 types of polymorphism
which are the overriding, the methods of a subclass override the methods of a superclass;
overriding (implementation) of the abstract methods, the methods of a subclass
implement the abstract methods of an abstract class; overriding through the Java
interface, the methods of a concrete class implement the methods of the interface.
(JPassion.com, 2012)
Encapsulation
Last but not least, encapsulation is another feature that provides data hiding in the
programming concept. This allows developer hides the internal implementation detail of
an object from its external views. Internal structure remains private and services can be
accessed by other objects only through messages passed via a clearly defined interface.
Encapsuation ensures that the object providing service can prevent other objects from
manipulating its data or procedures directly, and it enables the object requesting service
to ignore the details of how that service is provided (Cramerz.com). For instance, a
watch that displays the hour, minute and second to the user, the user does not need to
know the working principle of display the hour, minute and second while the user could
control and adjust the setting through the watch. Therefore, it involves hiding a data but
allow user to access through the interface.
However, hiding data is not the full extent of information hiding. David Parnas
first introduced the concept of information hiding around 1972. He argued that the
primary criteria for system modularization should concern the hiding of critical design
decisions. He stressed hiding difficult design decisions or design decisions which are
likely to change. Hiding information in that manner isolates clients from requiing
intimate knowledge of the design to use a module and from the effects of changing those
decisions (Wm. Paul Rogers, 2001)