by Kofi Sarfo
5. June 2009 16:56
I can't remember where I read something about having to read a decent amount of well written code in order to be able to understand how to code well. I think a parallel with writers and books was drawn somewhere nearby... Anyhow, this is why we've been hanging round the The Code Project since 2001 sometime and there appear excellent articles / code samples every so often; for example, the "Best C# article of April 2009" competition winner was Geoplaces. "A hybrid smart client, involving RESTful WCF/WPF and more." It's pretty.
It's a while since we wrote anything from scratch and those bits of code we've picked up in the last year don't look much like this. They don't look this good.
The Data Layer is all Entity Framework so happy to give that a miss but the Restful Service Layer is a nice intro into the System.ServiceModel namespace.
The Service Interface provides examples of ServiceContract and OperationContract. Backing up... MSDN: Introduction to Building Windows Communication Foundation Services. Note that this intro was written four years ago! Cut to mid 2009 and we still have indication of pain. Ayende: WCF Works in Mysterious Ways. IColloquialize: WCF Service References Generating Empty Root Proxy Classes. First takes suggest WCF might not be so straightforward.