π Objective:
Develop a simple eCommerce application using Object-Oriented Programming (OOP) principles in Java. The application should allow users to manage products, customers, and orders.
-
ποΈ Product
- Attributes: id, name, description, price, stockQuantity
- Methods: Constructors, getters, setters, toString()
-
π€ Customer
- Attributes: id, name, email, address
- Methods: Constructors, getters, setters, toString()
-
π Order
- Attributes: id, customer, productList (List of Product), totalAmount
- Methods: Constructors, getters, setters, calculateTotalAmount(), toString()
-
π¦ OrderManager
- Attributes: orderList (List of Order)
- Methods: addOrder(Order order), removeOrder(int orderId), viewAllOrders()
-
π₯ CustomerManager
- Attributes: customerList (List of Customer)
- Methods: addCustomer(Customer customer), removeCustomer(int customerId), viewAllCustomers()
-
π·οΈ ProductManager
- Attributes: productList (List of Product)
- Methods: addProduct(Product product), removeProduct(int productId), viewAllProducts(), updateStock(int productId, int newStock)
Create a Main class with a main method to interact with the user. Implement a simple text-based menu to perform the following actions:
- β Add a new product
- β Remove a product
- π View all products
- β Add a new customer
- β Remove a customer
- π View all customers
- π Create a new order
- π View all orders
The project should be organized into packages to separate different concerns:
- model: Contains the Product, Customer, and Order classes.
- manager: Contains the OrderManager, CustomerManager, and ProductManager classes.
- main: Contains the Main class with the main method.