# starshubham/creationaldesignpatterns architecture

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

- Interactive diagram: https://gitdiagram.com/starshubham/creationaldesignpatterns
- Repository: https://github.com/starshubham/creationaldesignpatterns

## Overview

This repository is a console demonstration of five creational design patterns. A user selects a pattern in the menu, and Program runs that example through its result: logging, a payment, rendered UI controls, a displayed employee, or a cloned employee. The diagram preserves each pattern as a separate branch and shows the main creation and invocation boundaries. Evidence is limited to the supplied source excerpts; README-described capabilities without sampled implementation details are shown only where the tree supports them.

Main entry points: [`CreationalDesignPatterns/Program.cs`](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Program.cs) (Pattern menu), [`CreationalDesignPatterns/Factory/FactoryMethod.cs`](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Factory/FactoryMethod.cs) (Payment factory), [`CreationalDesignPatterns/Builder/EmployeeBuilder.cs`](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Builder/EmployeeBuilder.cs) (Employee builder), [`CreationalDesignPatterns/Prototype/PEmployee.cs`](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Prototype/PEmployee.cs) (Prototype employee)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console entry"]
  node_program["Pattern menu<br/>[Program.cs]"]
end

subgraph group_singleton["Singleton"]
  node_logger["Logger<br/>[Logger.cs]"]
end

subgraph group_factory["Factory method"]
  node_payment_factory["Payment factory<br/>[FactoryMethod.cs]"]
  node_payment_interface["Payment contract<br/>[IPayment.cs]"]
  node_payment_types["Payment methods"]
end

subgraph group_abstract["Abstract factory"]
  node_ui_factory_contract["UI factory contract<br/>[IUIFactory.cs]"]
  node_platform_factories["Platform factories"]
  node_ui_contracts["Control contracts"]
  node_platform_products["Platform controls"]
end

subgraph group_construction["Object construction"]
  node_builder["Employee builder<br/>[EmployeeBuilder.cs]"]
  node_employee["Employee<br/>[Employee.cs]"]
  node_prototype_contract["Prototype contract<br/>[IPrototype.cs]"]
  node_prototype_employee["Prototype employee<br/>[PEmployee.cs]"]
end

node_user(("Console user"))

node_user -->|"chooses pattern"| node_program
node_program -->|"gets instance"| node_logger
node_program -->|"logs message"| node_logger
node_program -->|"requests payment"| node_payment_factory
node_payment_factory -->|"creates method"| node_payment_types
node_payment_factory -->|"returns contract"| node_payment_interface
node_program -->|"invokes payment"| node_payment_types
node_program -->|"selects factory"| node_platform_factories
node_platform_factories -->|"creates controls"| node_ui_contracts
node_program -->|"renders controls"| node_ui_contracts
node_program -->|"sets fields"| node_builder
node_program -->|"builds employee"| node_builder
node_builder -->|"returns employee"| node_employee
node_program -->|"displays employee"| node_employee
node_program -->|"clones employee"| node_prototype_employee
node_prototype_employee -->|"implements"| node_prototype_contract
node_program -->|"displays copies"| node_prototype_employee

click node_program "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Program.cs"
click node_logger "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Singleton/Logger.cs"
click node_payment_factory "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Factory/FactoryMethod.cs"
click node_payment_interface "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Factory/Interfaces/IPayment.cs"
click node_payment_types "https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/Factory/Services"
click node_ui_factory_contract "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/AbstractFactory/Interfaces/IUIFactory.cs"
click node_platform_factories "https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Services"
click node_ui_contracts "https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Interfaces"
click node_platform_products "https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Services"
click node_builder "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Builder/EmployeeBuilder.cs"
click node_employee "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Builder/Employee.cs"
click node_prototype_contract "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Prototype/IPrototype.cs"
click node_prototype_employee "https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Prototype/PEmployee.cs"

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_program,node_user toneBlue
class node_logger toneAmber
class node_payment_factory,node_payment_interface,node_payment_types toneMint
class node_ui_factory_contract,node_platform_factories,node_ui_contracts,node_platform_products toneRose
class node_builder,node_employee,node_prototype_contract,node_prototype_employee toneIndigo
```

## Components

### Console entry

- [Pattern menu](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Program.cs): `CreationalDesignPatterns/Program.cs`

### Singleton

- [Logger](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Singleton/Logger.cs): `CreationalDesignPatterns/Singleton/Logger.cs`

### Factory method

- [Payment factory](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Factory/FactoryMethod.cs): `CreationalDesignPatterns/Factory/FactoryMethod.cs`
- [Payment contract](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Factory/Interfaces/IPayment.cs): `CreationalDesignPatterns/Factory/Interfaces/IPayment.cs`
- [Payment methods](https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/Factory/Services): `CreationalDesignPatterns/Factory/Services`

### Abstract factory

- [UI factory contract](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/AbstractFactory/Interfaces/IUIFactory.cs): `CreationalDesignPatterns/AbstractFactory/Interfaces/IUIFactory.cs`
- [Platform factories](https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Services): `CreationalDesignPatterns/AbstractFactory/Services`
- [Control contracts](https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Interfaces): `CreationalDesignPatterns/AbstractFactory/Interfaces`
- [Platform controls](https://github.com/starshubham/creationaldesignpatterns/tree/master/CreationalDesignPatterns/AbstractFactory/Services): `CreationalDesignPatterns/AbstractFactory/Services`

### Object construction

- [Employee builder](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Builder/EmployeeBuilder.cs): `CreationalDesignPatterns/Builder/EmployeeBuilder.cs`
- [Employee](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Builder/Employee.cs): `CreationalDesignPatterns/Builder/Employee.cs`
- [Prototype contract](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Prototype/IPrototype.cs): `CreationalDesignPatterns/Prototype/IPrototype.cs`
- [Prototype employee](https://github.com/starshubham/creationaldesignpatterns/blob/master/CreationalDesignPatterns/Prototype/PEmployee.cs): `CreationalDesignPatterns/Prototype/PEmployee.cs`

### Other components

- **Console user**

## Connections

- Console user → Pattern menu: chooses pattern
- Pattern menu → Logger: gets instance
- Pattern menu → Logger: logs message
- Pattern menu → Payment factory: requests payment
- Payment factory → Payment methods: creates method
- Payment factory → Payment contract: returns contract
- Pattern menu → Payment methods: invokes payment
- Pattern menu → Platform factories: selects factory
- Platform factories → Control contracts: creates controls
- Pattern menu → Control contracts: renders controls
- Pattern menu → Employee builder: sets fields
- Pattern menu → Employee builder: builds employee
- Employee builder → Employee: returns employee
- Pattern menu → Employee: displays employee
- Pattern menu → Prototype employee: clones employee
- Prototype employee → Prototype contract: implements
- Pattern menu → Prototype employee: displays copies
