When & where should I use WCF

I looked through several online guides that cover the benefits of WCF, how to create a service / client, etc.

However, I want to know a little the whole picture.

Questions> Which application or which functions in the application require me to use WCF functions? A concrete example should help me better.

+6
source share
3 answers

There are several situations that will require WCF. First, it should be noted that “require” is a strong word, while WCF is the current preferred communication model in .NET, the platform has a history of other methods that are still supported.

Case Study 1 : Your web application does not work well, because part of the computational work of preparing the answer is “computationally expensive” and is powered by a processor. You want to move part of the expense to a service that works in a different field, where you can allocate isolated resources. You create a WCF service that wraps functionality and deploys this service in a different field, using a proxy class to access it over the network.

Concrete Example 2 : Your Windows application needs to access resources that are behind a firewall that your users cannot penetrate. So instead, you choose to deploy the service in the DMZ, which the application can use, and which of the DMZ accesses limited material and returns the results to your application.

WCF is a powerful tool and does incredible things to help service development, especially when you are developing SOAP-based services. On the other hand, many people think that currently an easier way to write RESTful services is to do this using ASP.NET MVC WebAPI. WebAPI began as a project of the WCF team, but was eventually transferred to MVC for various reasons. If you are interested in REST, I would recommend looking at the WebAPI.

+12
source

WCF is useful when creating applications or services that need to interact with each other.

You can use WCF to easily build programs that exchange data, whether through processes, through servers, or around the world.

+2
source

Think of WCF as a way to design your applications (functionality) across boundaries that are traditionally very difficult to cross. HTTP (S) is one way to enable this. Factor in REST principles, and you get some pretty elegant solutions that are very compatible. WCF-based services also give you more flexibility in how you can deploy your solution in different environments. This affects non-functional elements such as security and scaling, as well as discussions on a scale.

+2
source

Source: https://habr.com/ru/post/892257/


All Articles