https://github.com/furk4nbulut/e-commerce-application
Java e-commerce app built for CSE 1124 Object Oriented Programming course, showcasing classes for user, product, order, and credit card with full object-oriented structure and test cases.
https://github.com/furk4nbulut/e-commerce-application
java oop
Last synced: about 11 hours ago
JSON representation
Java e-commerce app built for CSE 1124 Object Oriented Programming course, showcasing classes for user, product, order, and credit card with full object-oriented structure and test cases.
- Host: GitHub
- URL: https://github.com/furk4nbulut/e-commerce-application
- Owner: Furk4nBulut
- Created: 2023-05-16T09:41:42.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-05-16T10:33:10.000Z (about 1 year ago)
- Last Synced: 2025-10-30T14:48:29.427Z (8 months ago)
- Topics: java, oop
- Language: Java
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ E-Commerce Application
Object Oriented Programming - Homework Project
**Manisa Celal Bayar University**
Faculty of Engineering - Computer Engineering
**2022-2023 Spring Semester**
> **Student:** Furkan Bulut
> **Student No:** 210316011
---
## ๐ Project Overview
This project simulates a basic **e-commerce application** using Java and Object-Oriented Programming principles such as encapsulation, constructors, method overloading, and data hiding. The system models Users, Products, Orders, and Credit Cards, supporting stock tracking, ordering, and payment processing functionalities.
---
## ๐ Contents
- [UML Diagram](#-uml-diagram)
- [User Class](#-user-class)
- [Product Class](#-product-class)
- [Order Class](#-order-class)
- [CreditCard Class](#-creditcard-class)
- [Main/Test Class](#-maintest-class)
---
## ๐ UML Diagram
> A UML class diagram is provided in the project folder that visualizes class relationships.
---
## ๐ค User Class
The `User` class represents a customer in the system.
### โ
Attributes:
- `fullName`, `email`, `password`, `phone`, `address`, `workAddress` (private `String`)
- `ArrayList` for favorite products and orders
### ๐ Constructor:
Initializes user details.
### ๐ง Methods:
- `addProductToFavorites(Product product)`
- `removeProductFromFavorites(Product product)`
- `addProductToOrder(Product product)`
- `removeProductFromOrder(Product product)`
- Getters and Setters for all fields
---
## ๐ฆ Product Class
The `Product` class defines the items available for purchase.
### โ
Attributes:
- `productName`, `productDescription`, `productCategory`, `productBrand`, `productColor`, `productSize`, `productPrice`, `productStock` (private)
### ๐ Constructor:
Initializes product details.
### ๐ง Methods:
- `boolean checkStock()`
Checks stock and returns `true` if available.
- `void reduceStock()`
Decreases the product's stock.
- `String toString()`
Returns a formatted product description.
---
## ๐งพ Order Class
The `Order` class manages the shopping process and interactions.
### โ
Attributes:
- `User user`
- `Product product`
- `CreditCard creditCard`
### ๐ Constructor:
Assigns ordering entities.
### ๐ง Methods:
- `void addToOrder()`
Adds product to order if stock is available.
- `void processPayment()`
Checks balance, deducts payment, reduces stock.
---
## ๐ณ CreditCard Class
The `CreditCard` class models user payment information.
### โ
Attributes:
- `cardNumber`, `expirationDate`, `securityCode`, `cardBalance`
- `User user`
### ๐ Constructor:
Initializes the card and its user.
### ๐ง Methods:
- Getters and Setters for all private fields
---
## ๐งช Main/Test Class
Used to test and simulate the application flow.
### ๐ Actions:
- Create two `User` instances
- Create two `CreditCard` instances
- Create two `Product` instances
- Test methods like adding to favorites, checking stock, placing an order, and processing payment
---
## ๐ฅ Sample Console Output
The test class demonstrates the functionality through printed messages including stock checks, successful or failed order messages, and balance updates.
---
## ๐ Note
All classes follow **OOP principles**:
- Encapsulation with `private` variables
- Use of **constructors** for initialization
- **ArrayList** is used to store collections of items
- **Getter and Setter** methods to access and modify data safely
---
## ๐ Author
**Furkan Bulut**
> Computer Engineering Student
> Manisa Celal Bayar University