Skip to content

Domain Model and Rationale

HamzaAlfarrash edited this page Oct 13, 2024 · 4 revisions

Domain Model

GameShop_Final_DM

Domain Model Rationale

The system’s user structure is built on an inheritance hierarchy, with an abstract Account class that standardizes common attributes such as email, password, name, and phoneNumber. This structure minimizes redundancy by allowing customer, employee, and manager accounts to inherit these shared attributes and behaviors. The decision to create a StaffAccount class for employees and the manager facilitates future scalability for other staff roles.

Enumerations like OrderStatus, RequestStatus, CategoryType, PromotionType, and GameReviewRating are used to enforce consistency across various states and classifications, simplifying system logic and ensuring clear, standardized processes. Certain relationships are modeled to reflect lifecycle dependencies, such as the composition between CustomerAccount and PaymentDetails, ensuring that when a customer account is deleted, its associated payment data is also removed.

The abstract GameEntity class, connecting Game and GameRequest, provides a shared structure for attributes like gameEntityID, name, description, and imageUrl, enabling consistent categorization. Furthermore, this design separates essential game information from transient aspects like request status or price, improving flexibility in managing catalog items.

Promotions are linked to both individual games and game categories, enabling targeted or broad promotional strategies, depending on stock levels or seasonal needs. The inclusion of RequestNote as a class linked to GameRequest is essential for tracking contextual details and approval history, offering transparency in request processing. Additionally, orders and reviews are associated with CustomerAccount, allowing customers to manage their order history and feedback independently of the games in the catalog, thus preserving order and review data even if specific games are removed. Finally, PaymentDetails is associated with both Order and CustomerAccount, reflecting a customer’s payment history in each order while linking payment details to the individual’s account.

Clone this wiki locally