Skip to content

This is a GUI java application that can process orders from clients. It works with a MySQL database.

Notifications You must be signed in to change notification settings

csabagabor/Order-processing-System-Java-MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Order Processing System in Java with MySQL

This is a GUI Java application that can process orders from clients. It works with a MySQL database. Uses the JDBC driver.

Use Cases...
As you can see a lot of stuff can be done like adding shippers, searching for products, orders etc.
image

image
This is the diagram of the relational database. A dump file is included in the project. Export it to your MySql Framework. The database was made using MySql WorkBench. image

Features

3 Tier package Architecture:

  • The Presentation layer consists of 4 classes and is organized on the MVC model:
    • View: it contains all the methods for constructing the GUI
    • Model: contains the methods that will further communicate with the Model classes
    • Controller: adds the functionality of the Model class to the View
    • TableContent: it is an enum and it is used to store the current state of the table showing on the screen(in the class View there is only 1 table and its content is always changed according to which button is pressed)
      - The Model layer contains 1 parent class and 6 child classes. For every table in the database, there is a corresponding class with EXACTLY the same field names and field data types.
    • Category, Client, Supplier, Shipper, Product, Orders – are the child classes
    • AbstractModel is the parent class and it extends AbstractBLL class(so every model class extends AbstractModel<T extends AbstractBLL> where T is the corresponding BLL class for every table. In this way, for every model class, its corresponding BLL class can be stored easily so the programmer does not need to verify it each time for what model class what bll class corresponds…
      - The Model Layer(BLL) contains classes that implement the application logic. The AbstractBLL abstract class contains the methods for communicating with the DAO classes(update/insert/delete/find). But it also contains methods which can be applied to different model objects before inserting them into the database or after extracting them from the database. For every model class there is a corresponding BLL class which extends the parent AbstractBLL and each of these classes override the getValidators() method which returns a List with the validators that need to be applied only to that particular model class.
    • validators: there is another subpackage named validators in the bll package which contains all the classes that are used for validating data: and Email validator, a Phone validator, and a Date validator. These classes implement the interface Validator and add functionality to the one, single method in the interface: validate.
    • data: for now, this subpackage contains only one class named OrderFile which does not else but creates a .txt file for each order.
      - The Infrastructure layer is further divided into 2 more packages: dao and connection.
    • connection: contains a singleton class ConnectionFactory which is responsible for accessing the database, retrieving connections and closing connections.
    • dao: contains an abstract class named AbstractDAO which implements all the necessary operations which need to be implemented on a table like: insert, delete, find by id, find all, update. It works with generic model objects. There are 6 other dao classes which are the children of AbstractDAO and they are the corresponding dao classes for the model classes one by one and they add full functionality to the parent class in the sense that the parent class knows with what type of data it is working on.
      image

UML Diagram

  • The UML diagram in the package dao:
    image
  • The UML diagram in the package model:
    image
  • The UML diagrams in the package bll with its 2 subpackages:
    image image
  • The UML diagram in the package presentation:
    image

Uses JOptionPane for operations:

image image image image image image

Uses JTable Click Listeners:

  • For updating a row, just press any cell and after modifying it, press the UPDATE button
    image

  • For deleting a row, click on it and press the DELETE button image image

Search is very simple:

  • Searching products which are under stock(have less than 5 available pieces):
    image image

Uses validators, cannot order product that is under stock etc.

image

Creates .txt files for every order

  • they are stored in the invoices folder image image image

Little GUIDE

  • After the application starts, the end user will see this: image
  • To view other tables, one button from the top needs to be pressed:
    image
  • For operations, use the buttons on the left:
    image
  • For updating a row, simply select the cell you want to modify, double click it and then modify to your needs. Then either press enter or double click elsewhere. Then press the update button.
  • For inserting a new row, press the insert button, and then introduce the new fields. Be attentive when introducing the values and introduce only valid data. Press OK. If you get the message: Insert Successful, it means that you inserted the row successfully else you will get a warning message alongside a log in the console. Check it to further explanation of the error.
  • For deleting a row, simply click once a row, and it will be colored in blue. Press the delete button. Whoala.
  • For searching for specific elements, you have to first choose the field for which you are applying the filter then in the input box, type your data for which you want to search. If the chosen field has a String format then the option bigger/smaller don’t have any purpose for now. Just press OK. All the rows having the field that contain the String you entered will appear. For number formats, use the bigger/smaller button to search for bigger, smaller values. If you do not select any of the 2, only equal values will be showed to you. When searching for Date format, you can use the bigger/smaller option as well to search for previous dates or dates after a given date.
  • To show the total number of rows, simply press the totals button and then enter. For the table Orders and Product there is one more option for selecting the total number of quantities.
  • GOOD LUCK!

About

This is a GUI java application that can process orders from clients. It works with a MySQL database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages