{"id":22444774,"url":"https://github.com/tarekmansour/decorator-pattern","last_synced_at":"2025-07-21T07:31:54.830Z","repository":{"id":184501078,"uuid":"614557274","full_name":"tarekmansour/Decorator-Pattern","owner":"tarekmansour","description":"Implement decorator pattern for caching strategy","archived":false,"fork":false,"pushed_at":"2023-08-25T17:29:58.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T06:51:15.305Z","etag":null,"topics":["csharp","decorator-pattern","design-patterns","dotnet"],"latest_commit_sha":null,"homepage":"","language":"C#","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/tarekmansour.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":"2023-03-15T20:43:28.000Z","updated_at":"2023-12-05T11:29:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba8d58dd-4f41-460e-91fb-8ed7b87f682b","html_url":"https://github.com/tarekmansour/Decorator-Pattern","commit_stats":null,"previous_names":["tarekmansour/decorator-pattern"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tarekmansour/Decorator-Pattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekmansour%2FDecorator-Pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekmansour%2FDecorator-Pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekmansour%2FDecorator-Pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekmansour%2FDecorator-Pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarekmansour","download_url":"https://codeload.github.com/tarekmansour/Decorator-Pattern/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekmansour%2FDecorator-Pattern/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266261119,"owners_count":23901284,"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","decorator-pattern","design-patterns","dotnet"],"created_at":"2024-12-06T03:10:00.128Z","updated_at":"2025-07-21T07:31:54.824Z","avatar_url":"https://github.com/tarekmansour.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decorator-Pattern\n\n- Decorator pattern is a structural design pattern that allows you to dynamically add new behavior to an existing class, without modifying the original class.\n- It's more flexible than inheritance.\n- Supports the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concerns\n\n## Usage\nI'm implementing the decorator pattern for caching strategy in this repository within a Product API HttpClient.\n\n### DI\n\nregister in DI when using `ProductClient` outside:\n\n```c#\nservice.AddProductsClient(new Uri(configuration.GetValue\u003cstring\u003e(\"ProductsApi:BaseUrl\")));\n\n//register cached client\nservice.AddCachedProductsClient(new Uri(configuration.GetValue\u003cstring\u003e(\"ProductsApi:BaseUrl\")));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarekmansour%2Fdecorator-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarekmansour%2Fdecorator-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarekmansour%2Fdecorator-pattern/lists"}