|
1 | | -# Software design patterns in Typescript |
2 | | - |
3 | | -Example code for design patterns. Where it makes sense classes and themes are continued across patterns. |
4 | | -These aren't supposed to be fully functioning source code but templates, examples, and descriptions to assist in solving problems. |
5 | | -The 23 Gang of Four (`GoF`) design patterns fall into three big camps: |
6 | | - |
7 | | -1. Creational Patterns |
8 | | -2. Structural Patterns |
9 | | -3. Behavioral Patterns |
10 | | - |
11 | | -## Creational Patterns |
12 | | -How do we create objects in a flexible way? |
13 | | - |
14 | | -- Singleton – only one instance allowed |
15 | | -- Simple Factory - Honourable mention not a true pattern |
16 | | -- Factory Method – let a method decide which subclass to instantiate |
17 | | -- Abstract Factory – a factory of related factories |
18 | | -- Builder – step-by-step construction |
19 | | -- Prototype – clone existing objects |
20 | | - |
21 | | -## Structural Patterns |
22 | | -How do we organise objects and classes? |
23 | | - |
24 | | -- Adapter – convert one interface to another (e.g., old plug to new socket) |
25 | | -- Bridge – separate abstraction from implementation |
26 | | -- Composite – tree structure (like folders & files) |
27 | | -- Decorator – wrap stuff to add behaviour, used to attach additional responsibilities to an object dynamically. |
28 | | -- Facade – a simple front for complex subsystems |
29 | | -- Flyweight – reuse shared objects to save memory |
30 | | -- Proxy – control access to an object (security, lazy loading etc.) |
31 | | - |
32 | | -## Behavioral Patterns |
33 | | -How do objects communicate and behave? |
34 | | - |
35 | | -- Strategy – swap algorithms at runtime, defines family of algorithms encapsulates each one and makes them interchangeable. |
36 | | -- Observer – event listeners / publish-subscribe. Defines one to many dependency between objects so that when one object changes state all it's dependents are notified. |
37 | | -- Command – encapsulate actions as objects |
38 | | -- Chain of Responsibility – pass requests down a chain |
39 | | -- Interpreter – language grammar representation |
40 | | -- Iterator – go through elements without exposing the structure |
41 | | -- Mediator – centralised communication between objects |
42 | | -- Memento – capture and restore object state |
43 | | -- State – change behaviour based on internal state |
44 | | -- Template Method – define skeleton of an algorithm with steps filled in by subclasses |
45 | | -- Visitor – add operations to objects without changing them |
| 1 | +# 🧠 Software Development Handbook |
| 2 | + |
| 3 | +## ✨ Foreword |
| 4 | + |
| 5 | +Software development is part art form, part mathematics, part science — and part vibe. |
| 6 | +This handbook is a curated collection of what I’m learning: design patterns, algorithms, data structures, and foundational concepts. |
| 7 | +It’s part learning tool, part long-term reference. |
| 8 | + |
| 9 | +It will grow as my knowledge and skills grow. I hope you find something useful in here, too — as I follow in the footsteps of giants and explore the endless world of code. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## 📚 Sections |
| 14 | + |
| 15 | +### 🎨 Design Patterns |
| 16 | +Structured approaches to common software architecture challenges. Based on the **Gang of Four** (`Gof`) patterns. |
| 17 | + |
| 18 | +- **Creational** |
| 19 | + - [Singleton](design_patterns/creational/singleton.ts) |
| 20 | + - [Factory Method](design_patterns/creational/factory.ts) |
| 21 | + <!-- - [Abstract Factory](design_patterns/creational/abstract_factory.md) --> |
| 22 | +- **Structural** |
| 23 | + - [Decorator](design_patterns/structural/decorator.ts) |
| 24 | + - [Proxy](design_patterns/structural/proxy.ts) |
| 25 | + <!-- - [Adapter](design_patterns/structural/adapter.md) --> |
| 26 | + <!-- - [Composite](design_patterns/structural/composite.md) --> |
| 27 | +- **Behavioral** |
| 28 | + - [Strategy](design_patterns/behavioral/strategy.ts) |
| 29 | + - [Observer](design_patterns/behavioral/observer.ts) |
| 30 | + <!-- - [Command](design_patterns/behavioral/command.md) --> |
| 31 | + |
| 32 | +📄 [Full Pattern Index](design_patterns/README.md) |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +### ⚙️ Algorithms & Data Structures |
| 37 | +Code implementations of core computer science techniques. |
| 38 | + |
| 39 | + |
| 40 | +- **Sorting Algorithms** |
| 41 | + <!-- - [Bubble Sort](algorithms/sorting/bubble_sort.js) |
| 42 | + - [Quick Sort](algorithms/sorting/quick_sort.js) |
| 43 | + - [Merge Sort](algorithms/sorting/merge_sort.js) |
| 44 | + - [Radix Sort](algorithms/sorting/radix_sort.js) --> |
| 45 | +- **Searching Algorithms** |
| 46 | + <!-- - [Binary Search](algorithms/searching/binary_search.js) |
| 47 | + - [Linear Search](algorithms/searching/linear_search.js) --> |
| 48 | +- **Recursion** |
| 49 | + <!-- - [Factorial](algorithms/recursion/factorial.js) --> |
| 50 | +- **Data Structures** |
| 51 | + <!-- - [Hash Table](algorithms/data_structures/hash_table.js) |
| 52 | + - [Linked List](algorithms/data_structures/linked_list.js) |
| 53 | + - [Stack](algorithms/data_structures/stack.js) --> |
| 54 | + |
| 55 | +📄 [Full Algorithm Index](algorithms/README.md) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +### 🧩 Core Programming Concepts |
| 60 | +In-depth notes and examples of important programming fundamentals. |
| 61 | + |
| 62 | +<!-- - [Callback](concepts/callback.md) |
| 63 | +- [Closure](concepts/closure.md) |
| 64 | +- [Event Loop](concepts/event_loop.md) --> |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## 🔄 Contributions |
| 69 | +This repo is intended as a personal learning journal, but feel free to open issues or PRs if you spot something helpful to add or improve. |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## 📜 License |
| 74 | + |
| 75 | +[MIT](LICENSE) |
0 commit comments