简体   繁体   English

大型项目中进程间通信的最佳和最简单的方法

[英]Best and Easiest Method for inter-process communication in large project

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.我的要求是在普通的 Windows 窗体应用程序和 Windows 服务之间进行通信。

Methods that are easy to maintain and implement are preferred.易于维护和实施的方法是首选。

Thanks谢谢

From the tags I understand that we are talking about .NET.从标签中我了解到我们在谈论 .NET。 Perhaps you should try Microsoft WCF.也许您应该尝试使用 Microsoft WCF。 It unifies this issue, abstracting specific inter-process (inter-service) communication technology from actual code.它统一了这个问题,从实际代码中抽象出特定的进程间(inter-service)通信技术。 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.因此,通常您将设计和编写您的进程将用来相互通信的接口,然后您将在 XML 配置文件中配置特定的通信技术。 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. WCF 支持 SOAP、TCP\\IP 通信、MSMQ 等,您的进程可以是 IIS 托管的 Web 服务、通常的 Windows 服务、控制台应用程序等 - 所有这些都在统一框架下。 I think, this is exactly what you are looking for.我想,这正是你要找的。

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.最常见的方法可能是 Web 服务。 Although these come with an overhead, so it may be worth looking at a simple interface API via a DLL.尽管这些会带来开销,因此通过 DLL 来查看一个简单的接口 API 可能是值得的。

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.无论您做什么,都应该仔细考虑和设计,考虑安全性和性能,以及您将来将如何扩展或修改它。

Not necessarily the best or the easiest....不一定是最好的或最简单的......

In the .NET world try MSMQ or IBM MQ message queue middle ware.在 .NET 世界中尝试 MSMQ 或 IBM MQ 消息队列中间件。

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.如果通信主要是单向的,那么可以考虑使用 WCF 服务,如果让 Visual Studio 中的代码生成器为您完成大部分工作,这既好又容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM