GoF_Patterns
GoF_Patterns
Factory Pattern
Category: Creational
Problem it Solves:
Creating instances like Course, Assessment, Certificate, or Subscription
may involve logic based on type or parameters. Using new directly in
client classes tightly couples the logic. Factory abstracts this creation.
Modified / Introduced:
Introduced:
Modified:
2. Singleton Pattern
Category: Creational
Problem it Solves:
Classes like AIAssistant represent a system-wide utility/resource that
should have only one instance to avoid conflicts or redundancy.
Modified / Introduced:
Modified:
Introduced:
3. Strategy Pattern
Category: Behavioral
Problem it Solves:
Different payment methods (e.g., credit card, PayPal, bank transfer) can
be implemented as interchangeable strategies in the Payment class,
making the class more flexible to extend and modify.
Modified / Introduced:
Introduced:
CreditCardPaymentStrategy, PayPalPaymentStrategy,
BankTransferPaymentStrategy: Implement IPaymentStrategy
with specific logic.
Modified:
4. Observer Pattern
Category: Behavioral
Problem it Solves:
When Instructor posts an Announcement, all enrolled Students should be
notified. Observer decouples the instructor from student notification logic.
Modified / Introduced:
Introduced:
Modified:
Student: Implements IObserver interface.
5. Adapter Pattern
Category: Structural
Problem it Solves:
If third-party APIs (e.g., external grading system or content delivery
platform) need to be integrated with Course or Grade, Adapter helps wrap
the incompatible interface without modifying existing system.
Modified / Introduced:
Introduced:
Modified: