{"id":51369832,"url":"https://github.com/knapeczadam/head-first-design-patterns-cpp","last_synced_at":"2026-07-03T05:07:30.310Z","repository":{"id":101367019,"uuid":"296142090","full_name":"knapeczadam/head-first-design-patterns-cpp","owner":"knapeczadam","description":":factory: Head First Design Patterns implemented in C++","archived":false,"fork":false,"pushed_at":"2025-10-24T06:46:10.000Z","size":149,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T08:39:23.780Z","etag":null,"topics":["cplusplus","cpp","design-pattern","design-patterns","designpattern","designpatterns","head-first","head-first-design-patterns","headfirst","headfirstdesign","headfirstdesignpatterns"],"latest_commit_sha":null,"homepage":"","language":"C++","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/knapeczadam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-09-16T20:34:48.000Z","updated_at":"2025-10-24T06:46:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"16193d2b-0fd9-4ef7-a28b-0b9e72851649","html_url":"https://github.com/knapeczadam/head-first-design-patterns-cpp","commit_stats":null,"previous_names":["knapeczadam/head-first-design-patterns-cpp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/knapeczadam/head-first-design-patterns-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knapeczadam%2Fhead-first-design-patterns-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knapeczadam%2Fhead-first-design-patterns-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knapeczadam%2Fhead-first-design-patterns-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knapeczadam%2Fhead-first-design-patterns-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knapeczadam","download_url":"https://codeload.github.com/knapeczadam/head-first-design-patterns-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knapeczadam%2Fhead-first-design-patterns-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35072872,"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-07-03T02:00:05.635Z","response_time":110,"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":["cplusplus","cpp","design-pattern","design-patterns","designpattern","designpatterns","head-first","head-first-design-patterns","headfirst","headfirstdesign","headfirstdesignpatterns"],"created_at":"2026-07-03T05:07:29.812Z","updated_at":"2026-07-03T05:07:30.283Z","avatar_url":"https://github.com/knapeczadam.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HeadFirstDesignPatternsCPP\n\n### TODO\n- raw vs. smart pointers\n- rules of zero, three, five\n- this vs enable_shared_from_this\n- thread safety\n- passing smart pointers by value/reference\n- missing patterns\n- Copy policy\n- memory leak/optimization\n\n### Design Patterns\n1. BO - \u003cb\u003eStrategy\u003c/b\u003e: defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. \n1. BO - \u003cb\u003eObserver\u003c/b\u003e: defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.\n1. SO - \u003cb\u003eDecorator\u003c/b\u003e: attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.\n1. Factory\n    1. CO - \u003cb\u003eAbstract Factory\u003c/b\u003e: provide an interface for creating families of related or dependent objects without specifying their concrete classes.\n    1. CC - \u003cb\u003eFactory Method\u003c/b\u003e: define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to the subclasses.\n1. CO - \u003cb\u003eSingleton\u003c/b\u003e: ensure a class only has one instance and provide a global point of access to it.\n1. BO - \u003cb\u003eCommand\u003c/b\u003e: encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.\n1. SC - \u003cb\u003eAdapter\u003c/b\u003e: converts the interface of a class into another interface clients expect. Lets classes work together that couldn't otherwise because of incompatible interfaces.\n1. SO - \u003cb\u003eFacade\u003c/b\u003e: provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.\n1. BC - \u003cb\u003eTemplate Method\u003c/b\u003e: define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.\n1. BO - \u003cb\u003eIterator\u003c/b\u003e: provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.\n1. SO - \u003cb\u003eComposite\u003c/b\u003e: compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.\n1. BO - \u003cb\u003eState\u003c/b\u003e: allow an object to alter its behavior when its internal state changes. The object will appear to change its class.\n1. SO - \u003cb\u003eProxy\u003c/b\u003e: provide a surrogate or placeholder for another object to control access to it.\n1. XX - \u003cb\u003eCompound\u003c/b\u003e: combines two or more patterns into a solution that solves a recurring or general problem. \n1. XX - \u003cb\u003eModel-view-controller\u003c/b\u003e: is a software design pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements.\n1. XX - \u003cb\u003eAnti-Pattern\u003c/b\u003e: tells you how to go from a problem to a BAD solution.\n1. SO - \u003cb\u003eBridge\u003c/b\u003e: use the Bridge Pattern to vary not only your implementations, but also your abstractions.\n1. CO - \u003cb\u003eBuilder\u003c/b\u003e: use the Builder Pattern to encapsulate the construction of a product and allow it to be constructed in steps.\n1. SO - \u003cb\u003eFlyweight\u003c/b\u003e: use the Flyweight Pattern when one instance of a class can be used to provide many \"virtual instances\".\n1. CO - \u003cb\u003ePrototype\u003c/b\u003e: use the Prototype pattern when creating an instance of a given class is either expensive or complicated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknapeczadam%2Fhead-first-design-patterns-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknapeczadam%2Fhead-first-design-patterns-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknapeczadam%2Fhead-first-design-patterns-cpp/lists"}