{"id":25933444,"url":"https://github.com/hcvazquez/python-design-patterns","last_synced_at":"2026-06-11T07:31:11.029Z","repository":{"id":116217421,"uuid":"189502468","full_name":"hcvazquez/python-design-patterns","owner":"hcvazquez","description":"[A repository of design patterns implemented in python] The purpose of this repository is to record experience in designing object-oriented software as design patterns in python. Each design pattern systematically names, explains, and evaluates an important and recurring design in object-oriented systems. The goal is to capture design experience from the web in a form that people can use effectively. To this end some of the most important design patterns will be documented and will be presented them as a catalog.","archived":false,"fork":false,"pushed_at":"2019-08-14T17:05:52.000Z","size":58,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-03T22:40:43.916Z","etag":null,"topics":["design-patterns","python","python-3","software-design"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hcvazquez.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-31T00:51:13.000Z","updated_at":"2023-12-09T18:05:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5aa77bdd-14b5-47d3-854d-2f3365bfbf28","html_url":"https://github.com/hcvazquez/python-design-patterns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hcvazquez/python-design-patterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcvazquez%2Fpython-design-patterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcvazquez%2Fpython-design-patterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcvazquez%2Fpython-design-patterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcvazquez%2Fpython-design-patterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hcvazquez","download_url":"https://codeload.github.com/hcvazquez/python-design-patterns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcvazquez%2Fpython-design-patterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"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-11T02:00:06.485Z","response_time":57,"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","python","python-3","software-design"],"created_at":"2025-03-04T00:53:52.764Z","updated_at":"2026-06-11T07:31:11.024Z","avatar_url":"https://github.com/hcvazquez.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Design Patterns\n\nA repository of design patterns implemented in python.\n\n## What Is a Design Pattern?\n\nEach pattern describes a problem which occurs over and\nover again in our environment, and then describes the core of the solution to that\nproblem, in such a way that you can use this solution a million times over, without ever\ndoing it the same way twice. The simple meaning of a design patterns is *a solution to a problem in a\ncontext*.\n\nIn general, a pattern has four essential elements:\n\n1. The pattern name is a handle we can use to describe a design problem, its solutions,\nand consequences in a word or two. Naming a pattern immediately\nincreases our design vocabulary. It lets us design at a higher level of abstraction.\nHaving a vocabulary for patterns lets us talk about them with our colleagues,\nin our documentation, and even to ourselves. It makes it easier to think about\ndesigns and to communicate them and their trade-offs to others. Finding good\nnames has been one of the hardest parts of developing our catalog.\n\n2. The problem describes when to apply the pattern.It explains the problem and its\ncontext. It might describe specific design problems such as how to represent algorithms as objects.\nIt might describe class or object structures that are symptomatic\nof an inflexible design. Sometimes the problem will include a list of conditions\nthat must be met before it makes sense to apply the pattern.\n\n3. The solution describes the elements that make up the design, their relationships,\nresponsibilities, and collaborations. The solution does'nt describe a particular\nconcrete design or implementation, because a pattern is like a template that can\nbe applied in many different situations. Instead, the pattern provides an abstract\ndescription of a design problem and how a general arrangement of elements\n(classes and objects in our case) solves it.\n\n4. The consequences are the results and trade-offs of applying the pattern.Though\nconsequences are often unvoiced when we describe design decisions, they are\ncritical for evaluating design alternatives and for understanding the costs and\nbenefits of applying the pattern.\nThe consequences for software often concern space and time trade-offs. They\nmay address language and implementation issues as well. Since reuse is often a\nfactor in object-oriented design, the consequences of a pattern include its impact\non a system's flexibility, extensibility, or portability. Listing these consequences\nexplicitly helps you understand and evaluate them.\n\nPoint of view affects one's interpretation of what is and isn't a pattern. One person's\npattern can be another person's primitive building block. Here I have concentrated \non patterns at a certain level of abstraction as the described in Gamma's design patterns book. \nDesign patterns are not about designs\nsuch as linked lists and hash tables that can be encoded in classes and reused as is. Nor\nare they complex, domain-specific designs for an entire application or subsystem. The\ndesign patterns in this book are descriptions of communicating objects and classes that are\ncustomized to solve a general design problem in a particular context.\nA design pattern names, abstracts, and identifies the key aspects of a common design\nstructure that make it useful for creating a reusable object-oriented design. The design\npattern identifies the participating classes and instances, their roles and collaborations,\nand the distribution of responsibilities. Each design pattern focuses on a particular\nobject-oriented design problem or issue. It describes when it applies, whether it can be\napplied in view of other design constraints, and the consequences and trade-offs of its\nuse.\n\n## Classifying Patterns\nAccording to Gamma design patterns can be classified under three purposes. The three purposes are:\n\n### Creational\nHow an object can be created. This often involves isolating the details of object creation so your code isn’t dependent on what types of objects there are and thus doesn’t have to be changed when you add a new type of object. The aforementioned Singleton is classified as a creational pattern, and later in this book you’ll see examples of Factory Method and Prototype.\n\n### Structural\nDesigning objects to satisfy particular project constraints. These work with the way objects are connected with other objects to ensure that changes in the system don’t require changes to those connections.\n\n### Behavioral\nObjects that handle particular types of actions within a program. These encapsulate processes that you want to perform, such as interpreting a language, fulfilling a request, moving through a sequence (as in an iterator), or implementing an algorithm. This book contains examples of the Observer and the Visitor patterns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcvazquez%2Fpython-design-patterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcvazquez%2Fpython-design-patterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcvazquez%2Fpython-design-patterns/lists"}