{"id":26563837,"url":"https://github.com/webdevcaptain/design-patterns-ooad","last_synced_at":"2026-06-20T04:31:21.797Z","repository":{"id":265062708,"uuid":"895003209","full_name":"WebDevCaptain/design-patterns-ooad","owner":"WebDevCaptain","description":"Revisiting design patterns, documenting simple examples for reference and practice across multiple programming languages","archived":false,"fork":false,"pushed_at":"2025-01-28T07:24:27.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T05:31:59.806Z","etag":null,"topics":["design-patterns","gang-of-four-design-patterns","ooad"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDevCaptain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-27T11:41:41.000Z","updated_at":"2025-01-28T07:24:30.000Z","dependencies_parsed_at":"2025-08-19T01:30:25.907Z","dependency_job_id":null,"html_url":"https://github.com/WebDevCaptain/design-patterns-ooad","commit_stats":null,"previous_names":["webdevcaptain/design-patterns-ooad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WebDevCaptain/design-patterns-ooad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevCaptain%2Fdesign-patterns-ooad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevCaptain%2Fdesign-patterns-ooad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevCaptain%2Fdesign-patterns-ooad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevCaptain%2Fdesign-patterns-ooad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevCaptain","download_url":"https://codeload.github.com/WebDevCaptain/design-patterns-ooad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevCaptain%2Fdesign-patterns-ooad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34557551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-patterns","gang-of-four-design-patterns","ooad"],"created_at":"2025-03-22T16:18:18.760Z","updated_at":"2026-06-20T04:31:21.775Z","avatar_url":"https://github.com/WebDevCaptain.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Design Patterns (OOP)\n\nRevisiting all the major design patterns (inspired by Gang of Four and open-source material on the WWW).\n\n\u003e This repo should serve as a reference guide (not a tutorial) as I plan to add very simple examples to illustrate the patterns.\n\n---\n\n\u003cbr\u003e\n\n## Patterns Covered\n\n1. **Abstract Factory Pattern**\n\n- Creates families of related objects without specifying their concrete classes.\n- Provides a layer of abstraction for consistent object creation.\n- Merits: Ensures consistency across related objects; improves scalability and flexibility.\n\n---\n\n2. Adapter Pattern\n\n- Converts one interface into another that a client expects.\n- Acts as a bridge between incompatible interfaces.\n- Merits: Enhances reusability of code and compatibility between systems.\n\n---\n\n3. Bridge Pattern\n\n- Decouples an abstraction from its implementation so they can evolve independently.\n- Splits the \"what\" (abstraction) from the \"how\" (implementation).\n- Merits: Increases flexibility and allows independent development.\n\n---\n\n4. Builder Pattern\n\n- Constructs complex objects step-by-step by separating the construction process.\n- Useful for creating objects with many configuration options.\n- Merits: Improves code readability and allows for controlled, incremental object creation.\n\n---\n\n5. Chain of Responsibility Pattern\n\n- Passes requests along a chain of handlers until one handles it.\n- Each handler decides whether to process or pass the request.\n- Merits: Promotes loose coupling and simplifies request processing logic.\n\n---\n\n6. Command Pattern\n\n- Encapsulates a request as an object, allowing it to be executed, delayed, or queued.\n- Decouples sender and receiver by introducing a command interface.\n- Merits: Enables undo/redo functionality, improves extensibility.\n\n---\n\n7. Composite Pattern\n\n- Treats individual objects and compositions of objects uniformly.\n- Creates tree structures to represent part-whole hierarchies.\n- Merits: Simplifies working with hierarchical or nested structures.\n\n---\n\n8. Decorator Pattern\n\n- Dynamically adds behavior or functionality to objects without altering their structure.\n- Wraps objects with additional responsibilities.\n- Merits: Promotes flexibility and avoids subclassing for behavior changes.\n\n---\n\n9. Facade Pattern\n\n- Provides a unified interface to a set of interfaces in a subsystem.\n- Simplifies interaction with complex systems by offering a high-level API.\n- Merits: Reduces complexity and improves ease of use.\n\n---\n\n10. Factory Method Pattern\n\n- Defines an interface for creating objects but lets subclasses decide which class to instantiate.\n- Promotes the use of polymorphism.\n- Merits: Simplifies object creation and supports open/closed principle.\n\n---\n\n11. Flyweight Pattern\n\n- Shares common parts of objects to reduce memory usage.\n- Stores intrinsic state in shared objects and extrinsic state externally.\n- Merits: Improves performance and reduces memory footprint for large object collections.\n\n---\n\n12. Iterator Pattern\n\n- Provides a way to traverse elements of a collection without exposing its internal structure.\n- Ensures a consistent interface for iteration.\n- Merits: Improves maintainability and supports flexible iteration logic.\n\n---\n\n13. Mediator Pattern\n\n- Centralizes communication between components to avoid direct dependencies.\n- Components communicate via a mediator instead of directly with each other.\n- Merits: Reduces coupling and improves system scalability.\n\n---\n\n14. Memento Pattern\n\n- Captures and restores an object's state without exposing its internal details.\n- Used for undo/redo functionality.\n- Merits: Improves maintainability by encapsulating state restoration logic.\n\n---\n\n15. Observer Pattern\n\n- Establishes a one-to-many dependency between objects so that updates are automatically sent to dependents.\n- Subscribers (observers) are notified of changes in the subject.\n- Merits: Promotes loose coupling and ensures real-time updates.\n\n---\n\n16. Prototype Pattern\n\n- Creates objects by copying an existing object (prototype).\n- Useful when object creation is costly or complex.\n- Merits: Speeds up object creation and simplifies cloning logic.\n\n---\n\n17. Proxy Pattern\n\n- Provides a placeholder or surrogate to control access to another object.\n- Can add extra functionality like caching, logging, or security checks.\n- Merits: Enhances performance and security; improves access control.\n\n---\n\n18. Singleton Pattern\n\n- Ensures a class has only one instance and provides a global point of access to it.\n- Useful for managing shared resources like configurations or loggers.\n- Merits: Simplifies global state management but requires careful handling in multithreaded environments.\n\n---\n\n19. State Pattern\n\n- Allows an object to alter its behavior when its internal state changes.\n- Encapsulates state-specific behavior into separate classes.\n- Merits: Improves flexibility, readability, and maintainability for state-driven logic.\n\n---\n\n20. Strategy Pattern\n\n- Defines a family of algorithms and makes them interchangeable at runtime.\n- Encapsulates algorithm logic into separate classes.\n- Merits: Improves code reusability and supports open/closed principle.\n\n---\n\n21. Template Method Pattern\n\n- Defines the skeleton of an algorithm in a base class and lets subclasses override specific steps.\n- Promotes reuse of common logic while allowing customization.\n- Merits: Encourages code reuse and ensures consistency across implementations.\n\n---\n\n22. Visitor Pattern\n\n- Separates an algorithm from the objects it operates on by using a visitor object.\n- Adds new operations to classes without modifying them.\n- Merits: Supports open/closed principle and simplifies complex object structures.\n\n---\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n_Programming languages used:_\n\n- Python ✅\n- TypeScript ✅\n- Rust ✅\n- Go [TODO]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevcaptain%2Fdesign-patterns-ooad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevcaptain%2Fdesign-patterns-ooad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevcaptain%2Fdesign-patterns-ooad/lists"}