内部应用程序模块通信通过类似servicebus [英] Modules communication inside application by something like servicebus

查看:258
本文介绍了内部应用程序模块通信通过类似servicebus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要建立一个destop应用。结果
运营商可以与商店列表。他有他筛选店铺的主窗口,他有一些额外的窗口:图(显示商店的位置,标志着从列表中选择的店铺为粗体上图),股票的形式(查询所选店铺的股票外部服务)。
这些表格可以同时打开或其中一些可能是隐藏的,但主要形式。

We need to build a destop application.
Operator works with a list of shops. He has a main window where he filters shops and he has a number of extra windows: map(shows location of shops, marks the selected shop from list as bold on map), stock form(queries external service for stock of selected shop). The forms can be opened simultaneously or some of them can be hidden, except main form.

可能实施:结果
我认为每一个形式,我的应用程序的独立模块。为什么?我期望形式的数量将会增加。例如,对于在商店最新的销售新形式,另一种形式与店经理聊天。

Possible Implementation:
I consider each form as standalone module of my application. Why? I expect that number of forms will grow. For example, new form for latest sales in shop, another form for a chat with shop manager.

问题:结果
如何组织模块之间的通信?结果
现在我有一个主意,用共享总线和模块可以throught它发送和接收消息。结果
是否有其它方法吗?结果
是否有该总线的任何实现或者我足以与在发布/订阅模式直线前进的实施构建?

Questions:
How do I organize communications between modules?
For now I have an idea to use a shared bus and modules can send and receive messages throught it.
Are there any alternatives?
Are there any implementation of this bus or I'm enough with straight forward implementation build upon publisher/subscriber pattern?

推荐答案

首先,你需要保持分离的模块。否则,将导致与模块之间的依赖关系的地狱。结果
要做到这一点,最好的报价是用EventAggregator结构。虽然名字似乎作为事件,其实,这是一个总线结构来管理发布/订阅。

First, you need to keep the modules decoupled. Otherwise, it will result with a hell of dependencies between modules.
To achieve this, best offer is using an EventAggregator structure. Though the name seems as event, in fact, it's a bus structure to manage pub/sub.

您可以找到有关EventAggregator图案形式这里

You can find information about EventAggregator pattern form here.

.NET世界上有一个开源的API(名为棱镜)提供这种能力。我强烈建议你读取的此处和Digg源$ C ​​$ C。

.NET world have an opensource API (named Prism) providing this capability. I strongly suggest you to read the Event Aggregation section of Prism documentation from here and digg the source code.

目前,我们正在开发Silverlight应用程序这包括相互分离完全(无模块知道另一个实例/参考),并通过棱镜API通信不同的模块。

Currently we are developing a Silverlight application which is including different modules totally decoupled from each other (no module knows instance/reference of the other one) and communicating via Prism API.

这篇关于内部应用程序模块通信通过类似servicebus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆