Portobello Manager is a Java console application for managing a second-hand store inventory. Items are organized in a hierarchical catalog (categories and products), with total price calculation and export to a text file.
- Hierarchical Organization: Products and nested categories (Composite Pattern).
- Total Calculation: Recursive price sum for any category.
- Input Validation: Custom checked exceptions for invalid data (e.g. negative prices).
- Pricing Strategies: Full price or percentage discount on products (Strategy Pattern).
- Data Export: Catalog export via Singleton
DataServicetoexport_catalogo.txt.
- Composite —
CatalogItem,Product,Category - Factory —
CatalogFactory - Iterator —
StoreIterator(DFS on the catalog tree) - Singleton —
DataService - Strategy —
PricingStrategy,RegularPrice,PercentageDiscount
- Java SE 17
- Maven
- SLF4J / Logback
- JUnit 5
Requires JDK 17 and Maven.
mvn clean install
mvn testRun Main from the IDE or:
mvn exec:java -Dexec.mainClass="it.portobello.Main"
