This repository contains a Java-based course project for CPIT252.
The main idea of the project is to simulate a simple perfume store system using multiple object-oriented design patterns to organize the code and separate responsibilities.
The system demonstrates how a perfume store can handle:
- product creation
- configuration management
- discount application
- payment processing
- simplified store operations through a facade layer
The project is implemented in Java and structured as a desktop/console-based application.
Used in ConfigManager to ensure that only one configuration manager object exists in the system.
Purpose:
Manage shared configuration values such as currency and region.
Used in perfumeFactory to create perfume objects based on the selected type.
Purpose:
Encapsulate object creation and avoid direct instantiation in the main program.
Used through ProductDecorator and DiscountDecorator.
Purpose:
Add extra behavior to products dynamically, such as applying discounts without modifying the original perfume classes.
Used through PaymentStrategy, PayPalPayment, CreditCardPayment, and PaymentContext.
Purpose:
Allow switching between different payment methods at runtime.
Used in StoreFacade.
Purpose:
Provide a simple unified interface for the main store operations such as creating products, applying discounts, accessing configuration, and processing payments.
perfume→ abstract base class for all perfumesChannel→ represents Chanel No. 5Dior→ represents Dior SauvageMarc→ represents Marc Jacobs DaisyperfumeFactory→ creates perfume objects
ProductDecorator→ abstract decorator for perfume objectsDiscountDecorator→ applies a discount to a perfume
PaymentStrategy→ interface for payment behaviorPayPalPayment→ PayPal payment implementationCreditCardPayment→ credit card payment implementationPaymentContext→ executes the selected payment strategy
ConfigManager→ manages system configuration using SingletonStoreFacade→ provides simplified access to core store featuresProject252→ main entry point of the application
- Create different perfume products
- Display product name, price, and description
- Apply discount to selected products
- Choose between multiple payment methods
- Read configuration values such as currency and region
- Demonstrate multiple design patterns in one practical project
CPIT252/
│
├── project252/
│ ├── src/project252/
│ │ ├── perfume.java
│ │ ├── Channel.java
│ │ ├── Dior.java
│ │ ├── Marc.java
│ │ ├── perfumeFactory.java
│ │ ├── ProductDecorator.java
│ │ ├── DiscountDecorator.java
│ │ ├── PaymentStrategy.java
│ │ ├── PayPalPayment.java
│ │ ├── CreditCardPayment.java
│ │ ├── PaymentContext.java
│ │ ├── ConfigManager.java
│ │ ├── StoreFacade.java
│ │ └── Project252.java
│
└── Project_CPIT_252/
└── src/project_cpit_252/- Clone the repository:
git clone https://github.com/Reemajez/CPIT252.git-
Open the project in NetBeans or any Java IDE.
-
Navigate to the main source folder:
project252/src/project252/- Run the main class:
Project252.javaWhen the program runs, it can:
- load configuration settings
- create a perfume product
- apply a discount to the product
- ask the user to choose a payment method
- process the payment and display the result
This project was developed for the CPIT252 course to practice:
- object-oriented programming
- clean class design
- software design patterns
- separation of concerns
- practical Java development