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

Contents

 Introduction ........................................................................................................................ 2

 Abstract ............................................................................................................................... 2

 Requirements ...................................................................................................................... 2

 Screenshots with Explanation ............................................................................................. 3

 Class diagram ..................................................................................................................... 8

 Additional features ........................................................................................................... 13

 Drawbacks ........................................................................................................................ 13

 Conclusion ........................................................................................................................ 13

 References ........................................................................................................................ 14

1
 Introduction
Object Oriented Programming is a programming method that focuses on organising the code
by applying known methods while programming. Objects are used to make the same type of
information combination in different scenarios. Object oriented programming is one of the
most maintainable and reusable methods used to write code. It can be applied as object makers
and methods (Functions).

The following project mostly used the Object-Oriented method.

There are four main types of Object-Oriented Programming

1. Inheritance
2. Encapsulation
3. Abstraction
4. Polymorphism

 Abstract
The following report will clarify the idea behind the program and identify where the object-
oriented methods were used and why. The program was developed while making sure the
object-oriented methodology is followed as required. The report will clearly explain the Object-
Oriented types used as it will help clarify the program and the way it works.

 Requirements
The requirements for the project where to deliver an error free program where the main idea is
a type of Catalogue management system.

The program should allow 2 levels of access with different types of abilities and provided
options. The system should at least contain 2 Object oriented methods. For this project, the
information is to be stored in text files only. The program was kept simple and more focused
on the Object-Oriented aspect of the project.

2
 Screenshots with Explanation
The following screenshots are taken on the same computer of the same code keeping in mind
that only the important parts are taken screenshots for but all requirements are fulfilled and can

be checked on the program. Proper justification of the coding solution will be provided, and
additional features will be marked later in the document.

1. Login and sign Up

The first screen to appear will be a simple login screen that will check if the username and the
password match in the Accounts.txt file. A Sign-Up option was added to make it easier to
debug and test the program, it provides 2 types of signing up (Project Manager and Admin).

Figure 1.0 Login

3
Inheritance was used in this process where an Account class is made (Acc) and the project
manager and the admin extend it providing it with required information like the state and type
of user they are.

Figure 1.2 project manager menu

The Sign-up functions will check if the username or email have been used before, they’ll
require to enter the password twice too for additional confirmation.

Figure 1.3 (Category Edit Menu)

4
This is the menu that appears after a project manager logs in successfully, it has all the features
required, the user can edit their profile with the same interface provided for the login.

Figure 1.5 (View and search Menu)

This menu provides the user the ability to add, edit, and remove Categories easily. If the add
option is selected, the file will be checked for similar IDs and if the edit is selected the file will
find the matching id and change it. The information for the ID entered at the bottom space will

be deleted after the Remove button is clicked.

This menu provides the ability for the user to add, edit, and remove products, it also provides
the ability to view already made categories so that they can chose what category to add the
product to.

This is the View and search menu for the products. The table can be refreshed to show new
items if added, and the search button will find the product with that certain ID and display it

5
alone in the table. Keeping in mind that the same idea is applied over all the entities in the
project and use the same methods for viewing and searching and therefore the other view and
search menus won’t be shown.

The program has used Encapsulation throughout the entire process in every type of function.

A catalogue can be added ONLY by the project manager as seen in the requirements.

Figure 1.6 (Catalogue edit menu)

The ID will be checked before proceeding, adding, editing, and removing Catalogues is
possible. A certain Date period is provided between January and March as required. The title
(Event) will be added by the user, products can be viewed on the same page so that the user
can add products easily by clicking on them and selecting (Add Product to Catalogue) where
the products will be added to an Array list. Add Catalogues will add the catalogue to the text
file, Create PDF will create a PDF announcement and name it after the ID.

Figure 1.7 (Catalogue PDF created)

6
Figure 1.8 (.txt Accounts file)

The PDF document is made with the help of the itext Library, (if not installed the PDF
command will not work), please install the library so that testing the software is possible.

The stars (*************) act as identifiers to make reading, editing, and deleting possible.
This way of saving has been followed throughout the entire project.

7
The same methods where applied for the admin with extra features to edit, add, and remove
Project Managers and view the log summery to view all logins that happened, categories,
products, and catalogues can be viewed easily buy the admin and the project manager therefore
logging actions other than login times and information was not required.

 Class diagram

The relation between Signup1 class and autoID class many to one, also the autoID and
Aaddpm is one to one.

8
Then both the Aaddpm class and Signup1 class have a mutual relation with the class PM and
both classes have a relation with PM class (many to one)

As well as the PMedit it has a relation with PM class (many to one)

9
The PM class it has inheritance relationship with Acc and it extends between the classes as
well as the admin class it has inheritance relationship with Acc. And the Signup1 class has a
relation with the admin (many to one)

PMaddP class and the product class they have a relation (many to one) as it showed above

10
11
12
 Additional features
1. Full checking and confirmation of IDs.
2. Re-entering passwords for confirmation.
3. Viewing information on tables with them being selectable.
4. Compact Menu where all options are within reach.
5. Encapsulation used completely throughout the project.

 Drawbacks
1. The files can get messy with continues read and delete methods (But will never fall
faulty or provide miss information).
2. The GUI is not graphically flashy or appealing where most of the work was focused on
the object-oriented code.

 Conclusion
The project mainly focuses on applying Object Oriented methodologies as much as required,
in this program focused on encapsulation and abstraction the most where variables are made
mostly private. The program works without crashing or errors and can handle most user inputs.
All requirements have been handled directly or by another route.

13
 References
 Branislav Lazic. (2012). Hiding a frame in java upon a button click [Online]. Available
from: https://stackoverflow.com/questions/13278137/hiding-a-frame-in-java-upon-a-
button-click [Accessed: 28/7/2019].

 ss Blog, A. (2019). C#, JAVA,PHP, Programming ,Source Code: Java Import Text File
Data To JTable. [online] C#, JAVA,PHP, Programming ,Source Code. Available at:
https://1bestcsharp.blogspot.com/2017/08/java-import-text-file-data-to-jtable.html
[Accessed 1 Dec. 2019].

 pages, C. (2019). Creating PDF using JAVA (Netbeans) with images and multi pages.
[online] Stack Overflow. Available at:
https://stackoverflow.com/questions/35154723/creating-pdf-using-java-netbeans-with-
images-and-multi-pages [Accessed 2 Dec. 2019].

 row, J., Peramuna, S. and Fagoyinbo, D. (2019). Java JTable getting the data of the
selected row. [online] Stack Overflow. Available at:
https://stackoverflow.com/questions/29345792/java-jtable-getting-the-data-of-the-
selected-row [Accessed 2 Dec. 2019].

 www.javatpoint.com. (2019). How to Get Current Date and Time in Java - Javatpoint.
[online] Available at: https://www.javatpoint.com/java-get-current-date
[Accessed 2 Dec. 2019].

 [duplicate], H., Liyanage, S., Cat, T. and Shum, A. (2019). How to add File [] Array
content into ArrayList?. [online] Stack Overflow. Available at:
https://stackoverflow.com/questions/16437846/how-to-add-file-array-content-into-
arraylist [Accessed 2 Dec. 2019].

14
 Mkyong.com. (2019). iText – Read and Write PDF in Java – Mkyong.com. [online]
Available at: https://www.mkyong.com/java/itext-read-and-write-pdf-in-java/
[Accessed 2 Dec. 2019].

 Mkyong.com. (2019). iText – Read and Write PDF in Java – Mkyong.com. [online]
Available at: https://www.mkyong.com/java/itext-read-and-write-pdf-in-java/
[Accessed 1 Dec. 2019].

 yourbasic.org (n.d.) How to analyze time complexity. [Online]. Available from:


https://yourbasic.org/algorithms/time-complexity-explained/
[Accessed: 19/6/2019].

15

Вам также может понравиться