Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

TheRealTimo/DesignPatters.cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Design Patterns Showcase – Library Management System

This is a student project that explores core object-oriented design patterns through the context of a simple library management system. The goal was not to create a polished application, but to demonstrate the application of patterns like Decorator, Factory, Strategy, and Observer in a realistic but minimal use case.

Originally implemented as a Windows Forms app, it has been refactored to a console application to better focus on showcasing the design logic.


🧠 Patterns Demonstrated

  • Factory Pattern: Used to instantiate different types of books (NovelFactory, MagazineFactory) based on context.
  • Decorator Pattern: Adds dynamic functionality to books, such as:
    • LateFeeDecorator: Applies a late fee when a book is returned.
    • BorrowingPeriodExtensionDecorator: Extends the loan period.
  • Strategy Pattern: Controls the loan duration depending on the borrower:
    • StudentLoanStrategy
    • LibraryStaffLoanStrategy
  • Observer Pattern: Notifies library users when books become available.

πŸ§ͺ Example Features

  • Register students and library staff as observers.
  • Create books and add them to inventory.
  • Borrow and return books with different loan strategies.
  • Apply decorators to alter book behavior at runtime.
  • Get notified when a borrowed book is returned.

πŸš€ How to Run

Clone the repository:

git clone https://github.com/yourusername/DesignPatterns.git
  • Open the DesignPatterns.sln file in Visual Studio 2022 or later.
  • Ensure the project targets .NET 6.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages