mehadishakil/DesignPatternAssignment1

★ 0Forks 0C++GitHub ↗Compare

README

Design Patterns Demonstration

This repository contains the implementation and documentation of a project that demonstrates the understanding and application of various design patterns. The project aims to solve real-world scenarios by utilizing appropriate design patterns to achieve robust and maintainable solutions.

Table of Contents


Introduction

In the realm of software engineering, the application of design patterns plays a crucial role in achieving code maintainability, scalability, and overall system robustness. This project showcases the implementation of three design patterns across different scenarios, each addressing a unique problem.

Scenarios

Scenario 1

In a virtual Kingdom called MyOwnKingdom, people started promoting themselves as the King, which resulted in chaos. You are invited to re-program this virtual Kingdom to allow only one King to exist at any point of time even if people promoted and called themselves as Kings. A new King can be in place only if the existing King died or lost his Kingdom to another King in a war.

Scenario 2

You decide to start a new subscription service called NewsOnScreen. The objective of your service is to notify your subscribers of the announcements received on the VLE Blackboard from the Department of Computer Science at USW. Subscribers can unsubscribe from NewsOnScreen at any time when they wish to stop receiving updates (for example when they graduate). Execute this plan as a program so you can receive subscribers for NewsOnScreen.

Scenario 3

You have been hired by a new company called StudentCars to design their inventory system. The company produces two models (Amaze and Awe) which differ by the number of seats. Both the models offer the basic functionalities of a car which is to function as a mode of transport. Additional options include adding a Radio system, Bose MP3 system, Leather seats and Wheel illumination. Design and implement the inventory system.


Implemented Design Patterns

This project demonstrates the following design patterns:

  1. Singleton Pattern: Implemented in Scenario 1, for creating a kingdom where only one king can exist at any time.

  2. Observer Pattern: Implemented in Scenario 2, for managing the NewsOnScreen subscription service.

  3. Builder Pattern: Implemented in Scenario 3, for designing and configuring car models in the StudentCars inventory system.


Contributing

Feel free to clone this repository and experiment with the code. If you have suggestions or improvements for any of the scenarios or design patterns, please contribute by opening an issue or a pull request.

Contributors

mehadishakil

Issues