ITPub博客

首页 > 应用开发 > IT综合 > WCF Essentials (1)

WCF Essentials (1)

原创 IT综合 作者:yuzhangqi 时间:2010-05-28 10:17:40 0 删除 编辑

1. What Is WCF?

Windows Communication Foundation (WCF) is an SDK for developing and deploying services on Windows. WCF provides a runtime environment for your services, enabling you to expose CLR types as services, and to consume other services as CLR types.WCF is Microsoft's implementation of a set of industry standards defining service interactions, type conversion, marshaling, and various protocols' management. The first release of WCF provides many useful facilities for developing services, such as hosting, service instance management, asynchronous calls, reliability, transaction management, disconnected queued calls, and security. WCF also has an elegant extensibility model that you can use to enrich the basic offering. In fact, WCF itself is written using this extensibility model.Most all of the WCF functionality is included in a single assembly called System.ServiceModel.dll in the System.ServiceModel namespace.

WCF is part of .NET 3.0 and requires .NET 2.0, so it can only run on operation systems that support it.

2. Services

A service is a unit of functionality exposed to the world. In that respect, it is the next evolutionary step in the long journey from functions to objects to components to services.

The client of a service is merely the party consuming its functionality. The client can be literally anything : a Windows Forms class, an ASP.NET page, or another service.

Clients and services interact by sending and receiving messages. Messages may transfer directly from client to service or via an intermediary. With WCF, all messages are SOAP messages. Note that the messages are independent of transport protocolsunlike Web services, WCF services may communicate over a variety of transports, not just HTTP.

3. Services' Execution Boundaries

With WCF, the client never interacts with the service directly, even when dealing with a local, in-memory service. Instead, the client always uses a proxy to forward the call to the service. The proxy exposes the same operations as the service, plus some proxy-management methods.

Same-machine communication using WCF

Cross-machine communication using WCF

4. WCF and location transparency

In the past, distributed computing technologies such as DCOM or .NET Remoting aspired to provide the same programming model to the client whether the object was local or remote. In the case of a local call, the client used a direct reference, and when dealing with a remote object, the client used a proxy. The problem with this approach of trying to take the local programming model and make it the remote programming model is that there is much more to a remote call than an object with a wire. Complex issues such as life cycle management, reliability, state management, scalability, and security raised their heads, making the remote programming model significantly more complex, all because it tried to be what it is nota local object. WCF also strives to provide the client with the same programming model regardless of the location of the service. However, the WCF approach is the exact opposite: it takes the remote programming model of instantiating and using a proxy and uses it even in the most local case. Because all interactions are done via a proxy, requiring the same configuration and hosting, WCF maintains the same programming model for the local and remote cases; thus it not only enables you to switch locations without affecting the client, but also significantly simplifies the application programming model.

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13651903/viewspace-1033986/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: WCF Essentials (2)
请登录后发表评论 登录
全部评论

注册时间:2008-06-10

  • 博文量
    102
  • 访问量
    763304