Best WCF Book and WCF Resource - 2nd Edition
Update 12/5/2010: The 3rd edition of this book is out and it is pretty much the same as the 2nd edition. If you are interested in the Azure Service Bus, there is a new chapter. The new (3rd edition) book is still missing information for RESTful architectural design, so if you are looking for WCF REST look elsewhere.
- Here Comes the 2nd Edition
- Where and What is the New Content
- Updated Syntax
- Visual Studio 2008 Capabilities
- WCF .NET 3.5 & .NET 3.5 SP1
- ServiceModelEx Library
- Where is the REST?
- So what is in it for the Silverlight Developer?
I have over 50 books in my technical library (This includes ONLY active ones, after over a decade or so in IT. I have probably owned over 150 technical books and retired well over two-thirds of them). However, rarely is there a resource/book that comes out that I have referenced again and again (not even mentioning re-reading). A lot of these books I read mostly through. Some I even re-read or went back to parts. Very few of these books I considered a resource for a long time and went back to multiple times. The main reason is that with the advent of the internet, lots of books become outdated almost as soon as they are in print. A book has to be written really well and deliver insight that is hard to find elsewhere. This article is dedicated to my favorite WCF resource.
WCF is one of the harder technologies to master properly. It is an enterprise/business level technology that if you do not create these type of projects you will have very little exposure to the technology. Furthermore, the technology is very powerful and demands a deep understanding in order to implement properly. A lot of developers when looking to get started always look to Google to provide them with a good example from which to learn. WCF is one of those technologies where trying to learn from an example or an article on the web is the wrong approach. You could make that argument with every technology; however, when I started playing with Silverlight over a year ago or WPF, you can easily build on top of the knowledge you gain. However, WCF is an enterprise level SOA platform that has so many intricacies and gotchas that you need to know about. It makes trying to learn from a certain point (i.e., bindings, security, configuration) very hard. I fell into this trap as well when I first started playing with WCF a little back in 2006. I felt I was getting information in pieces and it was hard to grasp the overall concept or idea Microsoft was trying to convey with WCF.
How did I finally get my "aha" moment with WCF? Almost 2 years ago I bought Programming WCF Services by Juwal Lowy. This book is essentially an evolution of another great book by Juwal Programming .NET Components. (It is all about coding in C# and utilizing component based architecture for design). Out of all my technical books, this is one that I have consistantly read and referred back to multiple times. Programming WCF Services is one of those books that reads like an "advanced placement physics book"; it gives you all the details and under-the-cover information. However, having all the tools, you still need to think and implement the concepts yourself. I absolutely love this type of format because it focuses less on trying to build examples or "tell" you how to code. It covers most of the intricate topics with WCF (binding, configurations, security, reliable services, etc.) and allows you to make your own decisions on what is best for you.
Here Comes the 2nd Edition
Programming WCF Services was published on February 2007. Therefore, a large majority of the book was written in 2006. This is obviously before Visual Studio 2008, Silverlight, .NET 3.5, .NET 3.5 SP1, ADO.NET Data Services, LINQ, C# 3.0, etc., were all released. Since then many new concepts were added to WCF in .NET 3.5 as well. Furthermore, since 2006, the concept of REST-based services really picked up in adoption. Furthermore, there is an increase of frameworks and best practices that have been vetted in large scale SOA deployments. Juwal Lowy updated his great book with a 2nd Edition and it is updated with all sorts of new information. The 2nd edition was officially released just a few weeks ago in October 2008.
The 2nd edition of Programming WCF Services has been updated with a lot of great new .NET 3.5 sp1 techniques that have been released since the first publication of the book. I have both editions of the book. First, you can see that the book is a little thicker. Juwal mentioned the book was about 200 pages of extra content in an interview I heard over a month ago. I don't know if anything changed, but the book does not have 200 extra pages of content. The first edition of the book is 610 numbered pages. The 2nd edition of the book is 750 numbered pages. Obviously, doing the simple math, we now have an extra 140 pages.
You can see the 2nd Edition has noticably more content
140 pages more of WCF goodness
Where and What is the New Content
The book is organized the same way as the first edition of the book. The chapters and their sequence between the two editions is identical. Aside from several new additions to the Appendix, the overall structure of the book is the same. So where is the new content? The new content is well placed within the overall design of the book. This is a great decision because of how well the book is laid out. The book introduces the different parts that make up the WCF architecture very well and it enforces the concepts by adding to it. For example, this is perfectly demonstrated when the topic of WCF object serialization is dicussed. Juwal shows how you can do it using "traditional" .NET methods. However, DataContracts are quickly introduced as the preferred method of serialization. The concept of data contract serialization quickly becomes more complex with object inheritance, versioning, serializtion events and inferred contracts are introduced. As you can see, this is a real good way of building on a concept that might be new to even experienced developers.
As the concepts are introduced and built upon, Juwal introduces new C# 3.0 techniques, LINQ and lambda expressions into the various procedural code snippets and examples in the book. This is really nice as you can see how much better these new techniques make working with WCF API easier. LINQ and lambda expressions make their appearance in more than several examples in the book. This is a real good way of seeing how these new techniques are more than just "syntax sugar" and really add value to programming. You are also seeing how to utilize the new code from a software legend :)
Visual Studio 2008 Capabilities
WCF was introduced as part of the .NET 3.0 framework in 2006. If you remember, this did not coincide with a new release of Visual Studio. .NET 3.0 was an addition to .NET 2.0 and Visual Studio 2005. Therefore, the tool support for WCF was not completely baked. Visual Studio 2008 was released as part of the .NET 3.5 release and WCF has received enhanced support inside Visual Studio 2008. Throughout the book screenshots and notes highlight on how to do certain functions relating to WCF in Visual Studio 2008. Obviously this brings the 2nd edition to a much needed update as many developers have moved on to Visual Studio 2008.
WCF .NET 3.5 & .NET 3.5 SP1
WCF has been enhanced in several areas since it was introduced in .NET 3.0. Some of the new .NET 3.5 WCF enhacements include ADO.NET Data Services, data contract serialization, REST support, WF integration and AJAX/Silverlight supported WCF services. Unfortunately, the book only coveres all these new concepts minimally. For example, the new data contract serialization in .NET 3.5 is covered in detail; however, most of the other new additions to WCF are completely omitted. This is understandable as this would have added a lot more pages to the book and would have taken the book in a different direction.
The book also includes descriptions and excerpts from the ServiceModelEx library. This framework for WCF is on idesign's website and available for free. The book does go over some of the ways you can use the framework to make the WCF programming easier. While this is a nice addition, this was available for free for a while on the web site. This code is peppered throughout the book; however, it is hard to tell if the code is part of the ServiceModelEx framework unless you check out the appendix.
Where is the REST?
This book is the BEST WCF self-paced resource on the market. Having said that, this resource is missing one of the biggest trends in SOA design paradigms: Representational State Transfer (REST). Well, isn't there probably is at least an excerpt about how REST should be avoided? Wrong. There is absolutely nothing in the book that I could find about REST at all. This is completely inexcusable for several reasons. REST is a valid enterprise service design. Many of the largest service organizations are using REST APIs (i.e., Amazon, MySpace). In fact, MySpace is based on WCF REST principles. Some of the additions in .NET 3.5 such as URL re-writting were specifically added for REST design and are omitted in this resource. REST design for "data-based" services is actually a lot more efficient (cachable, stateless, less chatty) than other WS* standards based WCF services.
I am not sure what Juwal Lowy's stance is on REST design. If you find any interviews, podcasts or presentations online, you will probably hear Juwal's message that WCF deprecates the .NET programming model. He makes a valid point that other software engineering principles rely on writing a lot of plumbing code. WCF programming (not just SOA) is a step in the direction of true design of software. Essentially this is what REST design tries to do by embracing the web as for what it is and not try to "force" other designs into services. This is why I think the omission of REST from the book is disappointing.
So what is in it for the Silverlight Developer?
There is actually very little here in terms of content strictly directed at the Silverlight developer. As mentioned above, RESTful design and ADO.NET Data Services are not mentioned in the book. This is a big dent for Silverlight developers as the only other WCF capabilities that are available are basicHttpBinding and duplex binding. If you attended any of Juwal's, talks, he calls basicHttpBinding "brain dead" binding. BasicHttpBinding is obviously not covered in real rigor in the book other than to say it is not recommended at all. WS* standards based bindings are heavily recommended for the web.
Even with the limited coverage of some of Silverlight's key data access strategies, this book is an EXCELLENT resource for Silverlight developers. As I mentioned above, this book reads like a physics book. You do not have "direct content" strictly directed at the Silverlight developer. However, the book builds a very solid foundation for WCF design. If you go on the http://www.silverlight.net/ forums, you will see a majority of the questions for Silverlight are directed at either control examples or data access with Silverlight. I think a lot of ASP.NET/Flash/Winforms developers are making the jump to Silverlight WITHOUT properly understanding WCF fundamentals. You simply cannot design a data/service heavy application in Silverlight without understanding some very key Silverlight concepts. From some of the basic questions being asked, you can see that Silverlight developers are struggling with the basics of WCF and what Silverlight supports for WCF.
This is why I believe that even though there is no Silverlight examples or best practices for Silverlight and WCF, this resource is invaluable for any serious Silverlight developer working with service-based data. Before even STARTING a WCF based project, a developer needs to understand service contract design, contract serialization, WCF architecture (proxies, channels, interceptors), configuration (bindings, behavious), security (transport, message), etc.
In summary, if you want to learn about WCF or need a good WCF resource for a project, BUY this edition of this book. This book is simply invaluable in how well it presents the information at a very high technical level. The information has been updated for .NET 3.5 and includes over 140 pages of new content. The content is presented extremely well and each topic builds on itself. While it is disappointing that certain topics like REST have been omitted and there is no direct content for Silverlight developers, this book is still a great resource for any WCF developer. Having said all that, this book is meant as a resource and reads like a college engineering book. All the tools are laid out for you and how everything works including the gotchas; however, the solutions are missing [no simple plug in the numbers from an example here :)].