Вы находитесь на странице: 1из 23

Name: LEONG WENG FON

TP No: TP038881

Intake Code: UC2F1708(CS)

Module: CT038-3-2-OODJ

Coursework Title: Individual Assignment

Date Assigned: 25/9/2017

Date Completed: 4/12/2017

Word: 1586 words


Table of Contents
Introduction .................................................................................................................................................. 3
System Design ............................................................................................................................................... 4
Class Diagram ................................................................................................................................................ 4
Use case Diagram .......................................................................................................................................... 5
Activity Diagram ............................................................................................................................................ 6
Code Implementation of Object-Oriented Concepts .................................................................................. 13
The Result of System................................................................................................................................... 16
Conclusion ................................................................................................................................................... 20
References .................................................................................................................................................. 22
Introduction

Object-Oriented Programming is a programming methodology based on objects, instead of just


functions and procedures. These objects are organized into classes, which allow individual
objects to be group together. Most modern programing languages including Java, C/C++ and
PHP, are object-oriented languages, and many older programming languages now have object-
oriented versions.

An “object” in an OOP language refers to a specific type, or “instance”, of a class. Each object
has a structure like other objects in the class, but can be assigned individual characteristics. An
object can also call functions. Or methods, specific to that object. For example, the source code
of a video game may include a class that defines the structure of characters in the game.
Individual characters may be defined as objects, which allows them to have different
appearances, skills and abilities. They may also perform different tasks in the game, which are
run using each object’s specific methods.

Object-Oriented Programming makes it easier for programmers to structure and organize


software programs. Because individual objects can be modified without affecting other aspects
of the program, it is also easier to update, and change programs written in object-oriented
languages. As software programs have grown larger over the years, OOP has made developing
these large programs more manageable. (techterms, 2017)

The benefits of object-oriented technology are ease of software design, productivity, easy testing,
debugging and maintenance, it’s reusable, more through data analysis, less development time
and more accurate coding, thanks to OOP’s inheritance method, data is safe and secure, with less
data corruption, thanks to hiding abstraction, it’s sharable like classes are reusable and can be
distributed to other networks. (upwork, 2017)
System Design

Class Diagram
Use case Diagram
Activity Diagram
Code Implementation of Object-Oriented Concepts

1) File Handling

In this assignment, use FileinputStream and FileOutputStream as file handling java language
based on Object-Oriented Concepts. The FileInputStream is a byte input stream class that
provide methods for reading bytes from a file. We can create an instance of this class by
supplying a File or a path name. the FileOutputStream is a byte output stream class that provides
methods for writing bytes to a file. We can create an instance of this class by supporting a File or
a path name, and/or specify to overwrite or append to an existing file. (upwork, 2017)
2) Inheritance

In Object-Oriented Programming, inheritance is the concepts that when a class of objects is


defined, any subclass that is defined can inherit the definitions of one or more general classes.
This means for the programmer that an object in a subclass need not carry its own definition of
data and methods that are generic to the class (or classes) of which it is a part. This not only
speeds up program development; it also ensures an inherit validity to the defined subclass object
(what works and is consistent about the class will also work for the subclass). (whatis, 2017) For
example: Car is a four wheeler vehicle so assume that we have a class Fourwheeler and subclass
of it named Car. Here Car acquires the properties of a class FourWheeler. Other classifications
could be a jeep, tempo. van, etc. FouwWheeler defines a class of vehicles that have four wheels,
and specific range of engine power, load carrying capacity etc. Car (termed as a sub-class)
acquires these properties from Fouwwheeler, and has some specific properties, which are
different from other classifications of FouwWheeler, such as luxury, comfort, shape, size, usage
etc. A car can have further classification such as open car, small car, big car, etc, which will
acquire the properties from both Four-Wheeler and Car, but will still have some specific
properties. This way the level of hierarchy can be extended to any level. (beginners, 2017)
3) Polymorphism

In Object-Oriented Programming, polymorphism is a programming language’s ability to process


objects differently depending on their data type or class. More specifically, it is the ability to
redefine methods for derived classes. For example, given a base class shape, polymorphism
enables the programmer to define different area methods for any number of derived classes, such
as circles, rectangles and triangles. No matter what shape an object is, applying the area method
to it will return the correct results. Polymorphism is a requirement of any true object-Oriented
programming language (OOPL). Polymorphism could be static and dynamic both. Method
Overloading is static polymorphism while Method overriding is dynamic polymorphism.
Overloading in simple words means more than method having the same method name that
behaves differently based on the arguments passed while calling the method. This called static
because, which method to be invoked is decided at the time of compilation. Overriding means a
derived class is implementing a method of its super class. The call to overridden method is
resolved at runtime, thus called runtime polymorphism.
The Result of System

Figure 1 show the login page in the system. User need to enter your ID and Password for
accessing the system. After user enter id and password and user click LOGIN button to log in.

Figure 2 show the admin main page. Admin able to access all function of the system. Admin can
register SM, PM and Admin. Admin can do all the function include SM and PM functions.
Figure 3 show the registration main page of the admin. Admin can register, view, delete and edit
user. The user registration includes Purchase Manager, Sales Manager and Admin itself.

Figure 4 show the supplier entry. Admin and Sales Manager can submit supplier data. The
function of supplier entry can add, view, delete, edit supplier.
Figure 5 show the item entry. This page is allow Admin and Sales Manager to submit the item
data. As you can see, you can see the table show the supplier entry table. When you click the
data in the table, supplier id will auto generate. Then, user can enter the detail of the item data.
The function of item entry is add, view, delete, edit item data.

Figure 6 show the daily item wise sales entry function. Admin and Sales Manager are able to
access the page above. As you can see, you can see the table show on the left hand side of the
frame, it show the item entry data. When user click the data on the table, it will show the detail
on the right hand side label and you enter your sale quantity and submit it. The function of the
Daily item wise sales entry is Add, View, Delete and Edit sales.
Figure 7 show the Purchase Requisition page. This function is only allow by admin and sales
manager. The table above show the supplier code, Item Code and so on. When user click the data
on the table, it show the data on the right hand side label and user need to enter purchase quantity
and click submit. It will save it in the text file. The Purchase Requisition file will send to
Purchase Order to approve the Purchase created by Sales Manager.
Conclusion

As a conclusion, the assignment has been done completed on time. There is a good and effective
system that had been developed. Before I study this module, I have learned some java languages
in my diploma program. So, I have some basic java programming languages then easier for me to
do this assignment, but I also meet some problem when doing the assignment. During the
process of doing assignment, there are some problems that have face such as bugs and errors.
However, these problems have been solved immediately because of get help from friends and
lecturer to solve the problem. In this assignment, I have learned more java programming
languages before I have learned java programming in my diploma program.

Limitation

Although the system has import many function but there some flow inside this system where it
cannot be done. The following below are some limitations in the system:

1) The system does not link to database and just create the text file for the purchase
manager, sale manager and admin.
2) The lack of design. The system does not have a nice GUI design.
3) The table show on the display has an empty column in every data that can show.
4) The Daily Sales Entry can create by today. If user forget to enter the data, it will not
show on the data.
Challenges

In this assignment, there are some challenges that faced. There are some challenges:

1) As you can see, the system has many challenges because the system is not good enough
compare to other people systems.
2) The lead of knowledge about programming language, so we have some problem on
develop the system and solved it immediately.

Enhancement

In future, I would implement the function below to improve the proposed system to make it more
efficiency and resolve the current limitation.

1) I will develop more effective system than the current system. For example, resolve the
current limitation.
2) I will develop an application for this system in the future. It will easier to access the
system efficiency for the user.
3)
References
beginners, 2017. [Online]
Available at: https://beginnersbook.com/2013/03/oops-in-java-encapsulation-inheritance-
polymorphism-abstraction/
[Accessed 4 12 2017].

techterms, 2017. [Online]


Available at: https://techterms.com/definition/oop
[Accessed 4 12 2017].

upwork, 2017. [Online]


Available at: https://www.upwork.com/hiring/development/object-oriented-programming/
[Accessed 4 12 2017].

upwork, 2017. [Online]


Available at: https://www.upwork.com/hiring/development/object-oriented-programming/
[Accessed 04 12 2017].

whatis, 2017. [Online]


Available at: http://whatis.techtarget.com/definition/inheritance
[Accessed 4 12 2017].