{"id":17551036,"url":"https://github.com/ttu/patterns-and-principles","last_synced_at":"2025-04-24T01:12:28.242Z","repository":{"id":139968462,"uuid":"133218252","full_name":"ttu/patterns-and-principles","owner":"ttu","description":"Code examples for Patterns and Principles - are these important anymore? training","archived":false,"fork":false,"pushed_at":"2024-02-27T17:02:03.000Z","size":80,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-24T01:12:21.822Z","etag":null,"topics":["csharp","design-patterns","dotnet-core","gof","uml"],"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/ttu.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}},"created_at":"2018-05-13T08:18:12.000Z","updated_at":"2023-02-04T09:48:26.000Z","dependencies_parsed_at":"2024-02-27T18:27:37.556Z","dependency_job_id":null,"html_url":"https://github.com/ttu/patterns-and-principles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttu%2Fpatterns-and-principles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttu%2Fpatterns-and-principles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttu%2Fpatterns-and-principles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttu%2Fpatterns-and-principles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttu","download_url":"https://codeload.github.com/ttu/patterns-and-principles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540928,"owners_count":21447427,"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":["csharp","design-patterns","dotnet-core","gof","uml"],"created_at":"2024-10-21T04:44:41.517Z","updated_at":"2025-04-24T01:12:28.223Z","avatar_url":"https://github.com/ttu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# Patterns \u0026 Principles\n\nCode examples for _Patterns and Principles: Are These Important Anymore?_-training.\n\nThe main aim of the training was to demonstrate how languages have evolved from the times when design patterns were often required, and to explain why and when some patterns should still be used.\n\nPattern examples are provided in _C#_ and some include _JavaScript_ implementations to show how these can be implemented using only functions. Some examples of principles are in _Python_.\n\nThe examples strive to utilize more real-life cases, although it is sometimes challenging to come up with a simple example.\n\nAdditionally, the examples contain UML class diagram code samples, as GoF Patterns are presented in UML.\n\nEach C#-file includes classes and interfaces for the pattern/principle, along with tests for executing the examples.\n\n## Patterns\n\n### Gang of Four\n\nGoF Pattern class diagrams: [Design Patterns Quick Reference (MCDONALDLAND)](http://www.mcdonaldland.info/2007/11/28/40/)\n\n#### Behavioral\n\n  * Command\n  * Observer\n  * Memento\n  * Strategy\n  * State\n  * Iterator\n    * Check implemenation from: \n      * https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/iterators\n      * https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable.getenumerator?view=netcore-2.2    \n  * __TODO__\n    * Template Method\n    * Visitor\n  * __TODO MAYBE__\n    * Chain of Responsibility\n    * Interpreter\n    * Iterator\n    * Mediator\n\n#### Creational\n\n  * Prototype\n  * Singleton\n  * Object Pool\n  * Factory / Factory Method\n  * Abstract Factory\n  * Builder\n\n#### Structural\n\n  * Adapter\n  * Composition\n  * Decorator\n  * Proxy\n  * Facade\n  * __TODO MAYBE__\n    * Bridge\n    * Flyweight\n\n### Other\n\nThese examples primarily compare functional and object-oriented patterns.\n\n  * Dependecy Injection\n  * Functions instead of DI\n  * OOP to Functions\n  * OOP vs FP modules\n  * Class vs closure\n  * Fluent interface / method chaining\n  * __TODO__\n\t  * Service Locator\n\t  * Repository\n      * Unit of work\n\n## Principles\n\n### SOLID Principles\n\n  * Liskov substitution\n  * Interface segregation\n  * __TODO__\n    * Single responsibility\n    * Open/Closed\n    * Dependency inversion\n\n### Other\n \n  * Coupling and Cohesion\n  * Encapsulation and Abstraction\n  * Inversion of Control\n  * IoC Container\n  * __TODO__\n    * Modularity \n    * Command Query separation\n\n## Links\n\n* https://sourcemaking.com/design_patterns\n* http://www.mcdonaldland.info/2007/11/28/40/\n* https://github.com/Lc5/DesignPatternsCSharp\n* https://github.com/abishekaditya/DesignPatterns\n\n#### Differences\n\n* https://softwareengineering.stackexchange.com/questions/178488/lsp-vs-ocp-liskov-substitution-vs-open-close\n* https://softwareengineering.stackexchange.com/questions/201397/difference-between-the-adapter-pattern-and-the-proxy-pattern\n* https://stackoverflow.com/questions/1658192/what-is-the-difference-between-strategy-design-pattern-and-state-design-pattern\n * https://stackoverflow.com/questions/17937755/what-is-the-difference-between-a-fluent-interface-and-the-builder-pattern*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttu%2Fpatterns-and-principles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttu%2Fpatterns-and-principles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttu%2Fpatterns-and-principles/lists"}