Also, when i need to communicate between loosely coupled objects (for example, MVVM
's ViewModel's), different books and blogs about best programming practices suggest use Mediator/EventAggregator patterns.
My question is about differences/relations between those patterns.
Can anyone describe them for me?
相关问题
- Generic Generics in Managed C++
- VNC control for WPF application
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
相关文章
- .net中MessageBox.Show使用问题
- IdentityServer 报错:"idp claim is missing"
- 在 IdentityServer 中如何给 id token 添加更多信息
- WPF:如何在Trigger里修改Orientation?
- IdentityServer 的 Selector 在哪个 nuget 包
- 使用 IdentityServer 的项目遭遇错误:"IDX20803: Unable to obt
- ASP.NET Core ConfigureServices 中从 appsettings.json
- WPF aforge 怎么做一个 圆形的播放器
The two are mostly used for the same reason; reducing coupling between classes. I have even seen implementations of both, doing exactly the same thing, namely passing information as a middleman from one object to another, without them knowing about each other.
However, (my interpretation is that) the difference lies in how the Mediator (should) encapsulate behavior, i.e. complex communication between objects, while an EventAggregator/MessageBus simply enables objects to subscribe to/publish events/messages without knowing who sent or will receive it.