Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is WCF (and pros and cons)?

Tags:

wcf

I am trying to understand what is WCF, but can't get a visual understanding of how it adds value (reading msdn does'nt help). I have worked with COM in the past, and I know about webservices. Can someone shed some light on what is WCF and its pros and cons (maybe how it relates to COM or replaces COM etc)?

If I can visualize the architecture layout, I can begin to understand what component does what function.

Links to reference web sites would also be great.

Thanks

like image 830
user279521 Avatar asked Mar 16 '10 15:03

user279521


People also ask

Whats is WCF?

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.

Is WCF still supported?

Just like Web Forms and other . NET Framework technologies, your WCF applications will continue to work for a long time. In fact, WCF will likely work for the next two decades thanks to . NET Framework being considered part of the windows operating system.

What is WCF .NET core?

Core WCF is a port of Windows Communication Framework (WCF) to . NET Core. Used to build service-oriented applications based on the . NET Framework, WCF enabled applications to asynchronously send data, packaged as messages, between service endpoints.

Should I use WCF?

WCF is useful when building applications or services that need to communicate with each other. You can use WCF to easily build programs that communicate, whether it's across processes, across servers, or across the world.


1 Answers

I don't recommend comparing WCF to COM.

Windows Communication Foundation is all about communication - In particular, from the WCF website, it "provides a unified programming model for rapidly building service-oriented applications that communicate across the web and the enterprise."

It's really a different approach to inter process communication, unifying it. It makes it so you can use a clean, service oriented API for all communication between processes, and easily change the underlying technology used by the services (ie: switch from HTTP to TCP to Pipes, etc).

By leveraging WCF, you can make processes that communicate between themselves in a clean, consistent manner. The same API can be used for talking to web services, passing data between two desktop applications, or communication between the desktop and a service on a system. In all cases, you can easily switch the protocols used, etc.

This provides a lot of flexibility with a single toolkit.


As far as pros and cons vs. other options - There are a lot of pros, mainly in terms of being able to use a unified development model. Personally, I use WCF for all of my current IPC needs, as it's pretty much replaced remoting as the preferred API for IPC in .NET.

The main con would be performance in some specific scenarios. Using WCF adds a (slight) overhead, so, in some situations, doing your own low level socket development will perform better. Unless you're writing a real time game or something like that, the development effort involved in a low level communication protocol isn't worth the gain, though.

like image 81
Reed Copsey Avatar answered Sep 18 '22 18:09

Reed Copsey