{"id":23974737,"url":"https://github.com/dizzydroid/designpatternsnutshell","last_synced_at":"2025-04-13T22:40:25.033Z","repository":{"id":271246133,"uuid":"882850799","full_name":"dizzydroid/DesignPatternsNutshell","owner":"dizzydroid","description":"Example code used in my handbook, Design Patterns in a Nutshell","archived":false,"fork":false,"pushed_at":"2025-01-10T00:26:28.000Z","size":2462,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T12:52:38.559Z","etag":null,"topics":["design-patterns","design-patterns-implemented-in-java","example-code","handbook","java","reference","software-engineering"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dizzydroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-11-03T22:59:18.000Z","updated_at":"2025-02-02T16:47:37.000Z","dependencies_parsed_at":"2025-01-07T03:03:26.053Z","dependency_job_id":null,"html_url":"https://github.com/dizzydroid/DesignPatternsNutshell","commit_stats":null,"previous_names":["dizzydroid/designpatternsnutshell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizzydroid%2FDesignPatternsNutshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizzydroid%2FDesignPatternsNutshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizzydroid%2FDesignPatternsNutshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizzydroid%2FDesignPatternsNutshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dizzydroid","download_url":"https://codeload.github.com/dizzydroid/DesignPatternsNutshell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794001,"owners_count":21162608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","design-patterns-implemented-in-java","example-code","handbook","java","reference","software-engineering"],"created_at":"2025-01-07T05:49:18.326Z","updated_at":"2025-04-13T22:40:24.958Z","avatar_url":"https://github.com/dizzydroid.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n\u003ca href=\"https://github.com/dizzydroid/DesignPatternsNutshell\"\u003e\n    \u003cimg alt=\"DesignPatternsNutshell Logo\" src=\"headerimg.png\" width=\"1000\"\u003e\n\u003c/a\u003e\n  \u003ch1\u003eDesign Patterns in a Nutshell\u003c/h1\u003e\n\u003c/div\u003e\n\nWelcome to the **Design Patterns in a Nutshell** repository! This repository is a companion to the handbook _Design Patterns in a Nutshell_ and is designed to provide practical, runnable examples for each pattern discussed. Whether you're a beginner or a seasoned developer, you'll find this resource invaluable for mastering design patterns.\n\n## 📚 What are Design Patterns?\n**Someone has already solved your problems**, \u003cbr /\u003e\n*“A design pattern is a well-known approach to solve a well-known problem that a (probably) well-known someone has faced.”* \u003cbr /\u003e\n\nPatterns are not a specific piece of code that you’d take in an off-the-shelf fashion, but rather a concept or a blueprint that you can apply and adapt into your software. They are a set of best practices that can be used to solve common problems in software design.\n\nThink of design patterns as a set of tools in your toolbox. Just like a carpenter uses a hammer to drive nails, you can use design patterns to solve common problems in software development. They provide a common language for developers to communicate and share solutions to recurring problems.\n\n## 📋 Pre-requisites\nThe handbook generally assumes a basic understanding of object-oriented programming concepts. The examples in this repo are particularly written in Java, but if you're familiar with other languages, you should be able to follow along.\n\nIf you're new to Object-Oriented Programming, consider learning the basics before diving into design patterns. Here are some great resources that I personally recommend:\n- [**Head First Java** by Kathy Sierra, Bert Bates, Trisha Gee](https://www.oreilly.com/library/view/head-first-java/9781492091646/)\n- [**Bro Code's full Java Course**](https://www.youtube.com/watch?v=xk4_1vDrzzo)\n- [**learnjavaonline.org**](https://www.learnjavaonline.org/)\n\nThe resources above (ordered by personal preference) will help you get started with Java and Object-Oriented Programming.\n\nThe handbook is designed to be beginner-friendly, so don't worry if you're new to design patterns. You'll find the examples and explanations easy to follow.\n\n---\n\n## 📂 Repository Structure\n\nThe repository is neatly organized into three main folders, corresponding to the **three families** of design patterns. Each pattern links directly to its folder and example:\n\n### **1. Creational Patterns** [(`/Creational Patterns`)](./Creational%20Patterns)\nFocus on object creation mechanisms, increasing flexibility and reuse:\n- [**Singleton**](./Creational%20Patterns/singleton)\n- [**Factory Method**](./Creational%20Patterns/factory-method)\n- [**Abstract Factory**](./Creational%20Patterns/abstract-factory)\n- [**Builder**](./Creational%20Patterns/builder)\n- [**Prototype**](./Creational%20Patterns/prototype)\n- [**Object Pool**](./Creational%20Patterns/object-pool)\n\n### **2. Structural Patterns** [(`/Structural Patterns`)](./Structural%20Patterns)\nDeal with the composition of classes and objects to form larger structures:\n- [**Adapter**](./Structural%20Patterns/adapter)\n- [**Proxy**](./Structural%20Patterns/proxy)\n- [**Decorator**](./Structural%20Patterns/decorator)\n- [**Flyweight**](./Structural%20Patterns/flyweight)\n- [**Composite**](./Structural%20Patterns/composite)\n- [**Bridge**](./Structural%20Patterns/bridge)\n- [**Façade**](./Structural%20Patterns/facade)\n\n### **3. Behavioral Patterns** [(`/Behavioral Patterns`)](./Behavioral%20Patterns)\nConcerned with algorithms and object interaction:\n- [**Template Method**](./Behavioral%20Patterns/template-method)\n- [**Observer**](./Behavioral%20Patterns/observer)\n- [**State**](./Behavioral%20Patterns/state)\n- [**Command**](./Behavioral%20Patterns/command)\n- [**Mediator**](./Behavioral%20Patterns/mediator)\n- [**Visitor**](./Behavioral%20Patterns/visitor)\n- [**Strategy**](./Behavioral%20Patterns/strategy)\n- [**Chain of Responsibility**](./Behavioral%20Patterns/chain-of-responsibility)\n- [**Iterator**](./Behavioral%20Patterns/iterator)\n\n---\n\n## ✨ Highlights\n\n- **Practical Examples:** Fully runnable code for every pattern.\n- **Embedded UML Diagrams:** Each pattern's markdown file includes a clear UML diagram for easy visualization.\n- **Beginner-Friendly:** Simple explanations and real-world use cases.\n\n---\n\n## 🎯 Goals of the Repository\n\n- Serve as a **reference** for understanding and implementing design patterns.\n- Provide a **hands-on approach** to supplement theoretical learning.\n- Offer **quick access** to runnable examples and diagrams for every pattern.\n\n---\n\n## 📚 Get the Handbook\nThis repository is a companion to the [Design Patterns in a Nutshell](https://drive.google.com/file/d/19qE0GULc0QBZ7pHO0XIFj_GkTRuBpd5v/view) handbook. \n\n---\n\n## 🙏 Acknowledgements\nThis handbook and repository are largely inspired by the incredible work by the authors of the book, [**Head First Design Patterns**](https://www.oreilly.com/library/view/head-first-design/9781492077992/). The book is a must-read for anyone interested in design patterns and I can't recommend it enough.\n\nPattern definitions, and some diagrams are inspired directly by the ones that started it all, the Gang of Four (GoF) book, [**Design Patterns: Elements of Reusable Object-Oriented Software**](https://www.oreilly.com/library/view/design-patterns-elements/0201633612/).\n\nSome examples and analogies were influenced by the amazing content on [**Refactoring Guru**](https://refactoring.guru/).\n\nThis repository and the handbook would not have been possible without the amazing resources above. I am grateful for the knowledge they have shared with the world.\n\n---\n\n## 📜 License\n\nThis repository is owned by **Shehab Mahmoud**. All content is protected under the terms of intellectual property. Refer to the [`LICENSE`](./LICENSE) file for additional details.\n\n---\n\n## ⚠ Disclaimer \nThis handbook includes content from third-party sources, including images and text excerpts. \nSuch content remains the property of their respective owners and is included here under \napplicable licenses or fair use. If you are the owner of any content and believe it has been \nused without proper permission, please contact us to resolve the issue.\n\n---\n\n## 🤝 Contributions\n\nContributions are welcome! If you’d like to suggest improvements, add examples, or fix bugs:\n- Open an issue or submit a pull request.\n- Refer to the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n---\n\u003cdiv align='center'\u003e\n  \u003cb\u003e Happy learning and coding! 🚀\u003c/b\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizzydroid%2Fdesignpatternsnutshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdizzydroid%2Fdesignpatternsnutshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizzydroid%2Fdesignpatternsnutshell/lists"}