# mohammedabdoh/design_patterns_course architecture

> Architecture diagram of the GitHub repository mohammedabdoh/design_patterns_course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohammedabdoh/design_patterns_course
- Repository: https://github.com/mohammedabdoh/design_patterns_course

## Overview

This repository is a PHP teaching collection of object-oriented concepts and design-pattern examples, not a single integrated application. Its clearest runnable workflow is the order-validation chain: `src/index.php` creates an order, assembles handlers, and invokes the chain; handlers check loyalty, product availability, shipment availability, and order handling. Other directories demonstrate separate creational, structural, and behavioral patterns. The graph reflects those independent examples; links are included only where the excerpts, source index, or README support them.

Main entry points: [`src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers`](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers) (Order Handlers), [`src/index.php`](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/index.php) (Order Demo Entry), [`src/Patterns/Behavioral/ChainOfResponsibility/Order/Order.php`](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Order.php) (Order Data), [`src/Patterns/Structural/Adapter/SMSAdapter`](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Adapter/SMSAdapter) (SMS Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_oop["OOP Concepts"]
  node_concepts["OOP Concepts"]
  node_relationships["Object Relationships"]
end

subgraph group_behavioral["Behavioral Patterns"]
  node_order_entry["Order Demo Entry<br/>[index.php]"]
  node_order_data["Order Data<br/>[Order.php]"]
  node_order_handlers["Order Handlers"]
  node_loyalty_check["Loyalty Check<br/>[Application.php]"]
  node_product_check["Product Check<br/>[Application.php]"]
  node_shipment_check["Shipment Check<br/>[Application.php]"]
  node_order_service["Order Service<br/>[Application.php]"]
  node_order_errors["Order Exceptions"]
end

subgraph group_creational["Creational Patterns"]
  node_abstract_factory["Abstract Factory"]
  node_computer_builder["Computer Builder"]
  node_http_builder["HTTP Client Builder"]
  node_factory_method["Factory Method"]
  node_prototype["Prototype"]
  node_singleton["Singleton<br/>[AppSettings.php]"]
end

subgraph group_structural["Structural Patterns"]
  node_sms_adapter["SMS Adapter"]
  node_bridge["Report Bridge"]
  node_composite["DTO Composite"]
  node_decorator["Notifier Decorator"]
  node_file_facade["File Converter Facade"]
  node_flyweight["Game Board Flyweight"]
  node_router["Router<br/>[Router.php]"]
  node_router_proxy["Router Proxy<br/>[RouterProxy.php]"]
end

node_learner(("Course User"))

node_learner -.->|"runs example"| node_order_entry
node_order_entry -->|"creates order"| node_order_data
node_order_entry -->|"assembles and invokes"| node_order_handlers
node_order_handlers -->|"checks loyalty"| node_loyalty_check
node_order_handlers -->|"checks availability"| node_product_check
node_order_handlers -->|"checks shipment"| node_shipment_check
node_order_handlers -.->|"records order"| node_order_service
node_order_handlers -->|"throws exceptions"| node_order_errors
node_order_data -->|"supplies order model"| node_order_entry
node_order_entry -->|"catches exceptions"| node_order_errors
node_http_builder -->|"references builder"| node_computer_builder
node_sms_adapter -.->|"adapts provider interface"| node_sms_adapter
node_router_proxy -.->|"delegates routing"| node_router

click node_concepts "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/OOP/Concepts"
click node_relationships "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/OOP/Relationship"
click node_order_entry "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/index.php"
click node_order_data "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Order.php"
click node_order_handlers "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers"
click node_loyalty_check "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/LoyaltyService/Application.php"
click node_product_check "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ProductAvailabilityService/Application.php"
click node_shipment_check "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ShipmentAvailabilityService/Application.php"
click node_order_service "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/OrderService/Application.php"
click node_order_errors "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Exceptions"
click node_abstract_factory "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/AbstractFactory/FormAbstractFactory"
click node_computer_builder "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Builder/ComputerExample"
click node_http_builder "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Builder/HTTPClient"
click node_factory_method "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/FactoryMethod"
click node_prototype "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Prototype/Employee"
click node_singleton "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Creational/Singleton/AppSettings.php"
click node_sms_adapter "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Adapter/SMSAdapter"
click node_bridge "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Bridge"
click node_composite "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Composite/DTOs"
click node_decorator "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Decorator"
click node_file_facade "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Facade/FileConverter"
click node_flyweight "https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Flyweight/GameBoard"
click node_router "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Structural/Proxy/RouterInterface/Router.php"
click node_router_proxy "https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Structural/Proxy/RouterInterface/RouterProxy.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_concepts,node_relationships,node_learner toneBlue
class node_order_entry,node_order_data,node_order_handlers,node_loyalty_check,node_product_check,node_shipment_check,node_order_service,node_order_errors toneAmber
class node_abstract_factory,node_computer_builder,node_http_builder,node_factory_method,node_prototype,node_singleton toneMint
class node_sms_adapter,node_bridge,node_composite,node_decorator,node_file_facade,node_flyweight,node_router,node_router_proxy toneRose
```

## Components

### OOP Concepts

- [OOP Concepts](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/OOP/Concepts): `src/OOP/Concepts`
- [Object Relationships](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/OOP/Relationship): `src/OOP/Relationship`

### Behavioral Patterns

- [Order Demo Entry](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/index.php): `src/index.php`
- [Order Data](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Order.php): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Order.php`
- [Order Handlers](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers`
- [Loyalty Check](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/LoyaltyService/Application.php): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/LoyaltyService/Application.php`
- [Product Check](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ProductAvailabilityService/Application.php): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ProductAvailabilityService/Application.php`
- [Shipment Check](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ShipmentAvailabilityService/Application.php): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/ShipmentAvailabilityService/Application.php`
- [Order Service](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/OrderService/Application.php): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Services/OrderService/Application.php`
- [Order Exceptions](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Behavioral/ChainOfResponsibility/Order/Exceptions): `src/Patterns/Behavioral/ChainOfResponsibility/Order/Exceptions`

### Creational Patterns

- [Abstract Factory](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/AbstractFactory/FormAbstractFactory): `src/Patterns/Creational/AbstractFactory/FormAbstractFactory`
- [Computer Builder](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Builder/ComputerExample): `src/Patterns/Creational/Builder/ComputerExample`
- [HTTP Client Builder](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Builder/HTTPClient): `src/Patterns/Creational/Builder/HTTPClient`
- [Factory Method](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/FactoryMethod): `src/Patterns/Creational/FactoryMethod`
- [Prototype](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Creational/Prototype/Employee): `src/Patterns/Creational/Prototype/Employee`
- [Singleton](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Creational/Singleton/AppSettings.php): `src/Patterns/Creational/Singleton/AppSettings.php`

### Structural Patterns

- [SMS Adapter](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Adapter/SMSAdapter): `src/Patterns/Structural/Adapter/SMSAdapter`
- [Report Bridge](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Bridge): `src/Patterns/Structural/Bridge`
- [DTO Composite](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Composite/DTOs): `src/Patterns/Structural/Composite/DTOs`
- [Notifier Decorator](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Decorator): `src/Patterns/Structural/Decorator`
- [File Converter Facade](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Facade/FileConverter): `src/Patterns/Structural/Facade/FileConverter`
- [Game Board Flyweight](https://github.com/mohammedabdoh/design_patterns_course/tree/master/src/Patterns/Structural/Flyweight/GameBoard): `src/Patterns/Structural/Flyweight/GameBoard`
- [Router](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Structural/Proxy/RouterInterface/Router.php): `src/Patterns/Structural/Proxy/RouterInterface/Router.php`
- [Router Proxy](https://github.com/mohammedabdoh/design_patterns_course/blob/master/src/Patterns/Structural/Proxy/RouterInterface/RouterProxy.php): `src/Patterns/Structural/Proxy/RouterInterface/RouterProxy.php`

### Other components

- **Course User**

## Connections

- Course User → Order Demo Entry: runs example
- Order Demo Entry → Order Data: creates order (evidence: `src/index.php`)
- Order Demo Entry → Order Handlers: assembles and invokes (evidence: `src/index.php`)
- Order Handlers → Loyalty Check: checks loyalty (evidence: `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers/LoyaltyHandler.php`)
- Order Handlers → Product Check: checks availability (evidence: `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers/ProductAvailabilityHandler.php`)
- Order Handlers → Shipment Check: checks shipment (evidence: `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers/ShipmentHandler.php`)
- Order Handlers → Order Service: records order (evidence: `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers/OrderHandler.php`)
- Order Handlers → Order Exceptions: throws exceptions (evidence: `src/Patterns/Behavioral/ChainOfResponsibility/Order/Handlers/ProductAvailabilityHandler.php`)
- Order Data → Order Demo Entry: supplies order model (evidence: `src/index.php`)
- Order Demo Entry → Order Exceptions: catches exceptions (evidence: `src/index.php`)
- HTTP Client Builder → Computer Builder: references builder (evidence: `src/Patterns/Creational/Builder/HTTPClient/Clients/Client.php`)
- SMS Adapter → SMS Adapter: adapts provider interface
- Router Proxy → Router: delegates routing
