大型项目中进程间通信的最佳和最简单的方法
在非常大的项目中可用于进程间通信的最佳和最简单的方法是什么?
我的要求是在普通的 Windows 窗体应用程序和 Windows 服务之间进行通信。
易于维护和实施的方法是首选。
谢谢
What is the best and easiest method that can be used for inter-process communication in a very large project?
My requirement is to communicate between a normal Windows Forms Application and Windows Services.
Methods that are easy to maintain and implement are preferred.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从标签中我知道我们正在谈论 .NET。 也许您应该尝试一下 Microsoft WCF。 它统一了这个问题,从实际代码中抽象出了具体的进程间(服务间)通信技术。 因此,通常您将设计和编写进程用于相互通信的接口,然后在 XML 配置文件中配置特定的通信技术。 也就是说,“进程谈论什么”和“这种通信是如何具体实现的”之间有相当清晰的分离。
WCF 支持 SOAP、TCP\IP 通信、MSMQ 等,您的进程可以是 IIS 托管的 Web 服务、常用的 Windows 服务、控制台应用程序等 - 所有这些都在统一的框架下。 我想,这正是您正在寻找的。
From the tags I understand that we are talking about .NET. Perhaps you should try Microsoft WCF. It unifies this issue, abstracting specific inter-process (inter-service) communication technology from actual code. So generally you'll design and write the interfaces that your processes will use to talk to each other and then you'll configure a specific communication technology in XML config file. That is, you have rather clear separation between "what do the processes talk about" and "how is this communication implemented specifically".
WCF supports SOAP, TCP\IP communication, MSMQ etc., you processes can be IIS-hosted web-services, usual Windows services, console applications etc. - all this under unified framework. I think, this is exactly what you are looking for.
这实际上取决于项目,因为有很多方法。
这可能取决于项目的不同部分运行的位置(它们可以运行在不同的服务器上,或者完全不同的技术堆栈上)。
最常见的方法可能是 Web 服务。 尽管这些都会带来开销,所以也许值得考虑通过 DLL 实现的简单接口 API。
无论您做什么,都应该仔细考虑和设计,考虑安全性和性能,以及将来如何扩展或修改它。
It really depends on the project as there are a large number of methods.
This may depend on where the different portions of the project run (They could run on different servers, or different technology stacks altogether.).
The most common method is probably web services. Although these come with an overhead, so it may be worth looking at a simple interface API via a DLL.
Whatever you do it should probably be thought about and designed carefully, considering security and performance, and how you will extend or modify it in the future.
不一定是最好的或最简单的......
在 .NET 世界中尝试 MSMQ 或 IBM MQ 消息队列中间件。
如果通信主要是单向的,那么请考虑使用 WCF 服务,如果您让 Visual Studio 中的代码生成器为您完成大部分工作,那么这既好又容易。
Not necessarily the best or the easiest....
In the .NET world try MSMQ or IBM MQ message queue middle ware.
If the communication is mostly 1-way, then consider using WCF services, which are both good and easy if you let the code generators in Visual Studio do most of the work for you.