You are on page 1of 16

INDIVIDUAL ASSIGNMENT

Module Name : Object Oriented Development with Java


Module Code : CT038-3-2-OODJ

Module Lecturer : Dr. Kadhar Batcha Nowshath

Date of Assign : 27th September 2017

Date of Completed : 5th December 2017

Name : Aiman Bin Idris

Student ID : TP047991

Intake : UC2F1708IT(BIS)

Title : Order Management System (POM)

1
Table of Contents

1.0 Introduction............................................................................................................... 1
2.0 Requirement Analysis
2.1 Use-Case Diagram ……………………………………………………...... 2
2.2 Class Diagram …………………………………………………………. 3–4
2.3 Activity Diagram – Add User …………………………………………. 5
2.4 Activity Diagram – Add Item …………………………………………. 5
2.5 Activity Diagram – Add Supplier ………………………………………. 6
2.6 Activity Diagram – Generate Purchase Requisition (PO) ………..…….. 6
2.7 Activity Diagram – Generate Purchase Order (PO) …………………….. 7
3.0 Implementation
3.1 Encapsulation …………………………………………………………….. 8
3.2 Inheritance ……………………………………………………………….. 9
3.3 Polymorphism …………………………………………………………… 10
3.4 Interface …………………………………………………………………. 11
3.5 Overriding ……………………………………………………………….. 12
3.6 Overloading ……………………………………………………………… 12
4.0 Conclusion……………………………………………………………………….. 13
5.0 Reference ………………………………………………………………………… 12

2
1.0 Introduction

An Order Management System (POM) was required to be developed as a project for


module assignment. This system was developed aimed for the user of three (3) types of user
which are Administrator, Sales Manager and Purchase Manager. The main drives for this
assignment is to allow the users automates the process of Purchase Orders to maintain the
purchases more effectively. The actual flow starts from Purchase Requisition (PR) by Sales
Managers (SM). It contains the item-code, quantity needed and the date by when it is required
to the company. Finally, after reviving the PR, the Purchase Manager (PM) generates a
Purchase Order (PO). It is an authorised document used by organisations for placing orders
with their suppliers for procurement of goods.

The objective for the assignment is to develop the practical ability to describe, justify,
and implement an Object-oriented system in the form of classes, arrays, polymorphism,
inheritance and many more. This system is created through Java Programming Language with
the help of software development platform which is IntelliJ IDEA. This platform provides an
advanced features and interesting development environment which allows us to debug the code
and having friendly interfaces. Aligned with the aim of this given project, there are several
objectives to be achieved such as providing users, user-friendly interface to ensure of use
throughout the use of the system. Besides that, progressing into a computerised and systematic
process handling transactions and data storage is another objective. Through the practice of this
system, transferring of information between administrator, purchase and sales manager are
made easy.

1
2.0 Requirement Analysis

2.1 Use Case Diagram

This diagram above shows the Purchase Order Manager use-case UML diagram that
consists the actor which is the user of the system. For example, in this diagram, it has
Administrator, Purchase Manager and Sales Manager. Secondly, it describes set of action
which is use-case that the system could perform with actors of the system. It is a specialization
of a class diagram and a structured diagram as a special case of class diagram where classifiers
are to be restricted to be either actor or use-case related to each other with association
(Fakhroutdinov, 2009-2016). For instance, in this diagram, it has “Add User” function and
other function as shown below inside the use-case symbol (oval).

2
2.2 Class Diagram

3
This diagram above shows the Purchase Order Management class diagram. It is a
structured UML diagram which shows structured of a design system which consist of classes,
interfaces and relationships. The classes and interface diagram contains the name, attribute and
operation of the class while the relationships of the class contain the type of relationship which
are generalization, association, composition, dependencies and multiplicity.
Inside the classes and interface diagram, the name must be noun phrases for example
on the diagram shown above, one of the implementation is Users and another implementation
is the capitalization of class name which is “UserFileStore”. Secondly, the attributes are what
an object known as and one of the implementation is the declaration of “uFName”, “uName”,
“uPswd”, “uAccess” inside the Users class. Lastly, operation defines the object action for
instance on the diagram shown above, the implementation is “userAdd” which this operation
is to add the user into the system.
The relationship implementation is generalization which is cover possible classes that
doesn’t have any corresponding objects such as the Administrator could manage the item.
Secondly, the implementation of association is defining the link of the object. For example,
administrator could manage the item. Thirdly, composition is one of the implementation. It’s
form of aggregation that the part is exclusively owned by the whole and its lifecycle is
dependent on the lifecycle of the whole. For example, Purchase Order is the composition of
Purchase Requisition which is to generate the Purchase Order, it required the data from
Purchase Requisition. Without it, it couldn’t generate at all. Fourthly, dependencies are also the
implementation. It means that the class at the source end of the relationship has some sort of
dependency on the class at the target end of the relationship. (Vernon, 2004). For example, the
“Users” class dependencies with “UserFileStore” which it depends another classes for data
storage. Finally, multiplicity is one of the implementation. It specifies how many instances of
a class could associate with instances of another class. For example, an Administrator could
add many items into the system and it’s one to many relationship (1...*).

4
2.3 Activity Diagram – Add User

[false]

Log In Authentication [true] Menu Display

[false]

Do they wish to
terminate the Do they wish to insert Check either the supplier
Check either the item code
program another item code is exist
is exist
[true] [false] [true] [false] Add Item

[true]

[false] [true]

Do they wish to insert


again the item
[false] [true]

2.4 Activity Diagram – Add Item

[false]

Log In Authentication [true] Menu Display

[false]

Do they wish to
terminate the Do they wish to insert Check either the supplier
Check either the item code
program another item code is exist
is exist
[true] [false] [true] [false] Add Item

[true]

[false] [true]

Do they wish to insert


again the item
[false] [true]

5
2.5 Activity Diagram – Edit Supplier

[false]

Manage
Log In Authentication [true] Menu Display
Supplier

[false]

[does the user wish to terminate the program] [check either the
supplier code exist]
[true] [true] Edit Supplier

[false]

2.6 Activity Diagram – Generate Purchase Requisition(PR)

[false]

Manage Purchase
Log In Authentication [true] Menu Display
Requisition

[false]

Does the user wish to Does the user wish to add Check either the required
terminate the program another PR data is exist and valid Create Purchase
[true] [false] [true] Requisition

[true] [false]

6
2.7 Activity Diagram – Generate Purchase Order(PO)

[false]

Log In Authentication [true] Menu Display

[false]

Does the user wish to Does the user wish to add Check either the required
terminate the program another PO data is exist and valid Generate Purchase
[true] [false] [true] Order

[true] [false]

This is an activity diagram which shows flow of control with emphasize the sequence of the
flow. It consists of initial and final node, action node, decision node and activity edge. Initial
node is a node where it starts the system while final node is where it terminates the system and
it notated as round circle. For instance, at the diagram above, the green node is the initial node
while the grey node is the final node. Secondly, action node is named element which represents
an action and it notated as round-cornered rectangle. For example, in the diagram, it shows an
action such as Log In and others. Thirdly, decision node is a control node that accept one or
more incoming edge(s) and contains outgoing edge from one or more outgoing flows. For
instance, in the diagram shown above, after the authentication, it proceeds to decision node
where it verified the user credentials. If the credentials match, it will proceed with true while if
the credentials un-match, it will proceed with false at finally it terminates the program. Lastly,
activity edge is an abstract class for the directed connections along which data objects flow
between activity nodes. For instance, in the diagram 2.4 above, after the “Add Item” activity
node, it connects to the edge that “Check either the item code is exist” and it will flow to the
next action. (Fakhroutdinov, 2009-2016)

7
3.0 Implementation

3.1 Encapsulation

This is an implementation of encapsulation. It is a mechanism that includes the variable


and methods together as single unit. In this method, the variables of a class will be hidden from
other classes and it can be accessed only through the methods of their current class. In the
sample code above, the implementation of it is on the variable part, it declares private while the
methods, it provides public getter and setter to view and modify the value of the variable. The
getter and setter methods are the access point of the instance variable and any class wish to
access this variable should access through these methods. For instance, on the code shown
above, these are the implementation on the User class where it uses for login authentication and
system acknowledgement. (Tutorials Point, n.d.)

8
3.2 Inheritance

This is an implementation of inheritance where a class acquires the properties from


another class. The class that inherits the properties of other class is known as subclass and the
class properties that inherited is known as superclass. To inherit other class properties, we
implement Extends keywords at the subclass as code example shown above. For instance, at
the code shown above, when the object of PurchaseManager (subclass) is extended with Users
(superclass) class, the copy of the contents of the superclass is created. This makes the subclass
could access the data of superclass. In this case, it links with the superclass constructor and
subclass constructor and at the subclass constructor, we implement super keyword which is to
address the superclass value. (Tutorials Point, n.d.)

9
3.3 Polymorphism

This is an implementation of polymorphism. It is an object ability to take on many forms.


It occurs when a parent class reference is used to refer to a child class object. All Java objects
are polymorphic and the possible ways to access an object through a reference variable. It can
be of only one type and the variable couldn’t be change once it declared. (Tutorials Point, n.d.)
For instance, at the code shown above, at ‘IEView()’ function, we declared the class of
‘ItemFileStore’ which it is an external class and its reference of ‘ifs’. Then we use the reference
variable which is ‘if’ to call the ‘ItemFileStore’ class function.

10
3.4 Interface

This is an implementation of interface. It is similar to class and a collection of abstract


methods. A class implements an interface thereby inheriting the abstract methods of the
interface. Writing this interface is similar with writing a class but class describes the attributes
and behaviour of the object while interface contains behaviour that a class implements. This
could content(s) constant(s), static and default methods and nested type(s). To implement it,
we use implement keyword to implement an interface at the class that needs it implementation.
For example, at the code shown above, we declared an interface of ‘DataStore’ which we
declared all the behaviours of class implements. Mostly it is a function that data store does. To
implement the interface, we declared an implements on the class that we should implement the
function which is item class.

11
3.5 Overriding

This is an implementation of overriding. It is a class that inherits from its direct


superclass and direct super interfaces all the non-private methods of the superclass and super
interfaces that are not accessible to code and are neither overridden by a declaration in the class.
This method differs from hiding of fields for it is permissible for an instance variable to hide a
static variable. For instance, at the code shown above, we declared ‘DataStore’ as the overriding
since it uses by two (2) classes which are Supplier and Item and the functions are use is same
type in both classes but different function (James Gosling, 1996-2000).

3.6 Overloading

This is an implementation of overloading. It is a method that overloads when two


methods of an interface have the same methods but different function. There is no relationship
between the return types or between the throws clauses of two methods with the same name
but different function. For instance, at the code shown above, we have same methods which are
‘MyDate’ but different parameter and function where the first initialization is we include the
parameter and declaration of it while at the second initialization we didn’t have any parameter
and we include getter from ‘GregorianCalendar’ class (James Gosling, 1996-2000).

12
4.0 Conclusion
To conclude, the goals and aim of this assignment were achieved as all requirements
assigned have been met. Deeper understanding and knowledge were gained when developing
the system and completing the documentation of this project. Although, there were some
challenges faced and enhancement that could be done on the project.
The challenges faced during the development of project are Java considered to have
large knowledge base and to implement it, it takes time. It has developed by using quite simple
function due to time constrains. It also developed to store data into text file which is quite easy
to implement. Although it’s easy to implement, but it still need deep validation in order to make
sure that it stores the data accurately.
The enhancement that could implement in future are implementation of database system
so that it could store and access the data more accurately and also it could synchronize the data
up to date. Finally, implements of Java Graphic User Interfaces (GUI) so that it provides user-
friendly interfaces and it makes the user comfortable to use it.

13
5.0 References
Fakhroutdinov, K., 2009-2016. Activity Diagrams. [Online]
Available at: http://www.uml-diagrams.org/activity-diagrams.html
[Accessed 3 November 2017].

Fakhroutdinov, K., 2009-2016. Use-Case Diagrams. [Online]


Available at: http://www.uml-diagrams.org/use-case-diagrams.html
[Accessed 3 November 2017].

James Gosling, B. J. S. B., 1996-2000. Method Declarations. In: The Java Language Specifications.
California: Sun Microsystem, pp. 1-390.

Nowshath, D. K. B., 2017. Diagrams [Interview] (25 October 2017).

Rivera, J. N., 2017. Simple CRUD (Add, Edit, Delete and View) in JAVA using .TXT(text) file as
database. [Online]
Available at: http://www.codeinquirer.com/simple-crud-add-edit-delete-and-view-in-java-using-
txttext-file-as-database/
[Accessed 29 September 2017].

Rizvi, S. F. M., 2017. Validation & Verification [Interview] (19 October 2017).

Tutorials Point, n.d. Java - Encapsulation. [Online]


Available at: https://www.tutorialspoint.com/java/java_encapsulation.htm
[Accessed 3 November 2017].

Tutorials Point, n.d. Java - Inheritance. [Online]


Available at: https://www.tutorialspoint.com/java/java_inheritance.htm
[Accessed 3 November 2017].

Tutorials Point, n.d. Java - Polymorphism. [Online]


Available at: https://www.tutorialspoint.com/java/java_polymorphism.htm
[Accessed 3 November 2017].

Vernon, V., 2004. Software Craftsman. [Online]


Available at: https://vaughnvernon.co/?page_id=31
[Accessed 3 November 2017].

14