tags:

views:

59

answers:

2

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

+1  A: 

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.

Reed Copsey
WCF can roughly be compared to DCOM, i think that is what author meant
Andrey
@Andrey: Well, it really does kind of replace the need for DCOM, but I personally think the mental model is different enough that thinking in DCOM terminology really hurts being able to grok WCF...
Reed Copsey
Can either of you provide a real world example where WCF could be used, and how that situation would been less efficient if WCF did not exist?
user279521
@user279521: I added some pro/cons to my answer. Does that help? WCF really is the preferred way to write inter process communication code in .NET - there's really no reason not to use it unless you're doing something that falls into an edge case...
Reed Copsey
It doesn't really help me in understanding what WCF does. I guess I need to get some solid hands on practice; It is possible to create a webservice application on your home machine (for practice purposes). Is it possible to create a wcf app on your home machine (something I can try with a sample app)?
user279521
Yes. Look at the WCF main page, and go through a couple samples. You can make a WCF service and client app very easily on your home machine. Try this: http://msdn.microsoft.com/en-us/netframework/first-steps-with-wcf.aspx
Reed Copsey
Thanks very much Reed. The intro videos were helpful. You went out of your way to answer my questions, and I sincerely appreciate that. Thank you VERY much.
user279521
A: 

WCF is very general framework for Interprocess/Intermachine communications. That's it. For .net options are: custom network comm, webservice, .net remoting. WCF substitutes webservice (backward compatible) and .net remoting (not backward compatible) with proving rich set of communication options and features. It can use different transport layers - tcp, web service, msmq

Andrey