翻译遇到了困难了?This service is a singleton service; every client starting a session does not instantiate a new instance of the service. This is to enable a single service to deal with many clients. This means that the first client calling t

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 12:31:37

翻译遇到了困难了?This service is a singleton service; every client starting a session does not instantiate a new instance of the service. This is to enable a single service to deal with many clients. This means that the first client calling t
翻译遇到了困难了?
This service is a singleton service; every client starting a session does not instantiate a new instance of the service. This is to enable a single service to deal with many clients. This means that the first client calling the service instantiates a new instance of the service, and each subsequent call is just calling the service operations. Service operations are methods or functions that the service implements; a service represents its operations in an interface, and represents the callback operations in another interface, asking a client to implement those callback operations, to be able to call the client again whenever it may want 这个是一个wcf的说明,希望大家能够把主要的意思翻译,谢谢!

翻译遇到了困难了?This service is a singleton service; every client starting a session does not instantiate a new instance of the service. This is to enable a single service to deal with many clients. This means that the first client calling t
这是一个独立的服务;每个客户端发起一个会话时并不需要实例化该服务的一个对象.所以它可以(并发)处理多个客户端(请求).也就是说第一个客户端请求该服务时实例化该服务的一个对象,接着每个并发请求都只是在调用该服务的一些操作(operations)(而不必再去实例化该服务的对象了),这些操作(operations)包括方法(methods C#中)或者过程(function VB中);一个服务将它的操作(operations)声明成一个接口,同时把回调操作声明在另一个接口中,让客户端来实现这些操作(operations)(也就是让客户端实现这个接口定义的那些回调方法),(同时)该服务对象(service)可以在任何时候访问客户端并回调客户端已经实现的那些方法(those callback operations)
好像还是很难懂的样子~举个例子吧
现在有两个应用程序,一个服务端,一个客户端,服务端会定义一些接口来让客户端调用,并且还声明了另一个接口(该接口的作用是让客户端实现了其具体方法后还可以让服务端程序回调这些方法),关于回调函数在C#里通常是以委托的形式存在的,在这里就不多说了,你搜一下C#回调函数了解下吧.当一个客户端程序连接上服务端程序以后就可以使用服务端程序所提供的公开方法了(通常这些方法是一些公用的业务逻辑,这些业务逻辑需要在不同的应用程序中调用,现在最广的做法是做成DLL来调用,但如果你机子上没有DLL的话就没办法调用这些业务逻辑方法了,同时DLL修改起来非常麻烦,而且也容易被反编译.有了WCF以后,这些业务逻辑都被保存在一个服务器上了,可以供任意的客户端程序来使用).
最最常见的例子就是各大门户网站的天气预报,天气预报服务商公开一个服务,这些网站使用这个服务就可以获取最新的天气预报并显示在自己的站点上了.