{"id":18798694,"url":"https://github.com/liteobject/mediatorpatterndemo","last_synced_at":"2026-01-02T03:30:13.000Z","repository":{"id":90789035,"uuid":"271160032","full_name":"LiteObject/MediatorPatternDemo","owner":"LiteObject","description":"Different implementation of the mediator concept","archived":false,"fork":false,"pushed_at":"2023-03-27T17:16:29.000Z","size":92,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T18:22:51.892Z","etag":null,"topics":["csharp","design-pattern","design-patterns","mediator-pattern"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"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/LiteObject.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}},"created_at":"2020-06-10T02:42:09.000Z","updated_at":"2023-04-06T15:44:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"e01473a2-fefc-4af7-acf1-7e53ce08a659","html_url":"https://github.com/LiteObject/MediatorPatternDemo","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/LiteObject%2FMediatorPatternDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FMediatorPatternDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FMediatorPatternDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FMediatorPatternDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiteObject","download_url":"https://codeload.github.com/LiteObject/MediatorPatternDemo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727055,"owners_count":19687099,"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-pattern","design-patterns","mediator-pattern"],"created_at":"2024-11-07T22:12:40.360Z","updated_at":"2026-01-02T03:30:12.939Z","avatar_url":"https://github.com/LiteObject.png","language":"C#","readme":"# A demo of Mediator pattern\n\u003eIn software engineering, the mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior... \n\u003e\n\u003e...with the mediator pattern, communication between objects is encapsulated within a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby reducing coupling. - Wiki\n---\n## What is Aspect Oriented Programming?\n\u003eIn computing, aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns, such as validation, logging, exception handling, security, caching, retry, etc. \n\u003e\n\u003eBasically the idea is to isolate the supporting functions from the main program’s business logic.\n\n---\n## Pros and Cons\n\n* **Single Responsibility Principle**: You can extract the communications between various \ncomponents into a single place, making it easier to comprehend and maintain.\n* **Open/Closed Principle**: You can introduce new mediators without having to change the actual components.\n* You can reduce coupling between various components of a program.\n---\n## MediatR Nuget Package\n\u003e Simple mediator implementation in .NET\n\n\u003e In-process messaging with no dependencies.\n\n\u003e Supports request/response, commands, queries, notifications and events, synchronous and async with intelligent dispatching via C# generic variance.\n---\n\n```mermaid\n%%{init:{\n    \"theme\":\"base\",\n    \"flowchart\": {\n        \"htmlLabels\": true,\n        \"curve\": \"basis\",\n        \"diagramPadding\": 50,\n        \"nodeSpacing\": 100,\n        \"useMaxWidth\": true\n    },\n    \"themeVariables\": {\n        \"primaryColor\": \"#BB2528\",\n        \"primaryTextColor\": \"#FFF\",\n        \"primaryBorderColor\": \"#BB2528\",\n        \"lineColor\": \"#000\",\n        \"secondaryColor\": \"#1ECBE1\",\n        \"secondaryTextColor\": \"#000\",\n        \"secondaryBorderColor\": \"#1ECBE1\",\n        \"tertiaryColor\": \"#FFF\"\n    }\n    }}%%\nflowchart LR\n    A(Web API)\n    C([Command]) \n    Q([Query])\n    M{MediatR}\n    QH([Query Handler])\n    CH([Command Handler])\n    D[(Database)]\n\n    A --\u003e C\n    A --\u003e Q\n    Q--\u003e M\n    C --\u003e M    \n    M --\u003e QH\n    M --\u003e CH\n    QH --\u003e D\n    CH --\u003e D\n  \n```\n---\n\n## Here we have three demos to show gradual changes/improvement and the use of the \"MediatR\" library.\n- MediatorPatternDemo\n- MediatorPatternDemo.V2\n- MediatorPatternDemo.V3\n- MediatorPatternDemo.Web (which uses the [MediatR nuget package](https://github.com/jbogard/MediatR))\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fmediatorpatterndemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliteobject%2Fmediatorpatterndemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fmediatorpatterndemo/lists"}