Inventory Desktop Application
Add Product Screen for Inventory Application
Introduction
My Software I course for my Computer Science degree required a final project where I had to create a
design document from an organization's needs and requirements and then develop the system based on
the design document. I was given a scenario and needed to develop something to solve the problems
in the scenario.
Requirements
In the scenario, a small manufacturing organization outgrew its current inventory system.
Previously, the organization used a spreadsheet program to manually enter any additions,
deletions, or changes. The organization provided me with a mock-up of the interface and a
UML Class Diagram to use in the design and development of the system.
The preferred IDE for the JavaFX application was Netbeans v8.2. The specified User Interface
provided in the mockup was required with little to no variations. The application must be
able to add, modify, and delete Parts and Products (products are made up of parts). Add,
Modify, and Delete Parts and Products each need a separate screen. The Parts screens must
be able to toggle between an "In-House" view and "Outsourced" view. The Products screens
must be able to associate existing parts with a product.
Exception controls with custom error messages were required in the implementation. The
exceptions included: restrictions to min/max values for parts/products, products must always
have at least one part in order to exist, confirmation dialogs for deletions and cancellations,
the price of a product must be greater than the cost of the parts, and all fields must be
filled in when creating a part/product.
Features
Object Oriented Principles (inheritance, encapsulation, abstraction)
Abstract classes were utilized because of the different types of Parts that existed.
In-house Parts and Outsourced Parts shared many things in common with the exception
of a few subtle differences, so they inherited from the abstract class and implemented
a few of their own methods. Encapsulation was used to bundle the data and hide the
instance variables of Parts and Products.
Exception Handling
Instead of crashing when a user does something the application does not support, exceptions
are handled in a graceful way. There are popups, alerts, and resets in order to prevent
actions that will cause the application to crash. Edge cases are tested in order to ensure
all exceptions are caught and handled.
User Interface Development
Along with Netbeans, I used SceneBuilder to create the GUI. SceneBuilder provided a user interface
where I could drag and drop items exactly where I needed them. Buttons, fields, and all the other
components could be sized, colored, and given an ID. I used the respective ID's in my code to
give specific functions to each part of the GUI.
Conclusion
I have used Java extensively throughout my college years, so I am very comfortable with the language.
Developing this application helped me to solidify what I already know about Object Oriented
Programming.
The application was built for a small organization, so the use of arrays to store
data worked just fine. If the application needs to be scaled up, a database will definitely
need to be used instead of the arrays.