The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,551,710
since: 19 Jan 2005

Agile Principles, Patterns, and Practices in C# (Robert C. Martin Series)

posted Wed 15 Nov 06
Agile Principles, Patterns, and Practices in C# (Robert C. Martin Series)

Robert C. Martin

Date: 2006-07-20   —   Book

product page

Rating:

Just recently, I wrote this blog post where I used the Monostate pattern to facilitate easier data binding in WPF applications. As mentioned in that blog post, I got the name for the pattern (but not the pattern itself) from this book.

I've read most of this book, skimming through some of the chapters in the beginning. Most of the chapters I was interested in were the pattern chapters themselves, which include:

  • SRP - The Single Responsibility Principle
  • OCP - The Open-Closed Principle
  • LSP - The Liskov Substitution Principle
  • DIP - Dependency Inversion Principle
  • ISP - Interface Segregation Principle
  • REP - Release-Reuse Equivalency Principle
  • CCP - Common Closure Principle
  • CRP - Common Reuse Principle
  • ADP - Acyclic Dependencies Principle
  • SDP - Stable Dependencies Principle
  • SAP - Stable Abstractions Principle

There are some extremely useful principles of Agile design in there, especially the Liskov Substitution Principle, which I have running through my head more often than bad songs or reminders to pick up bread on the way home from work. If you are looking for a good book on Agile programming and design, and you already have a good OOP background and you are already a C# programmer, then this book is absolutely for you.

The problem with this book is that the authors of the book are obviously not C# programmers for their day jobs. I have a couple of really large gripes with this book:

  1. The authors of the book regularly interchange the terms abstract base class and interface as if they mean the same thing. They do not mean the same thing, and they have entirely different impacts on design. Anyone reading this book who does not already have a really firm grasp on how C# interfaces differ from C# abstract base classes both technically as far as the CLR is concerned and from a design point of view - will be horribly confused.
  2. The authors are guilty of  "stacking the deck". By this I mean that many of their examples are flawed. All of these patterns are extremely good patterns, and good examples of why you would want to use these patterns are easy to find. However, in many cases throughout this book, the authors will show you a functional programming legacy C code sample as an example of the "bad", and a fully OOP C# code sample as an example of the "good". What people (including me) want is a C# example of what a bad implementation looks like and what a C# example of what a good implementation looks like. While the authors do provide this, I was put off by the sheer amount of raw C contained in this book, especially given the fact that this book includes C# in the title.
  3. The authors, while incredibly bright guys who obiously know what they're doing, occasionally miss a couple aspects of C# and .NET in general that would make for better samples. They completely neglect Generics in all samples, despite them being useful in a couple of the above mentioned patterns. In addition, they add needless complexity to a couple samples in the book to show the wrong way to do something, when no programmer who knows C# would do it that way to begin with (this is related to gripe #2). For example, delegates and events could have been used in one example illustrating the Dependency Inversion Principle and they weren't - making the example more difficult to follow and even more difficult to justify the refactoring.

To recap: If you already have strong programming skills, strong OOP skills, and a really good working knowledge of C#, then you can overlook the gripes I have about the book and get a flaming truckload of really good patterns, practices, and ideas to make your code and your design better.

If you are a novice C# programmer looking for some pattern advice, I recommend strongly that you skip this book. It will confuse you and perhaps even weaken your core abilities with C# because of all the incorrect syntax and terminology thrown around.

tags:                  

links: digg this    del.icio.us    technorati    reddit




1. Milan Negovan left...
Wed 15 Nov 06 2:29 pm

Hear hear. How about those horrid drawings? :) I published a review of this book at http://www.aspnetresources.com/blog/agile_principles_book_review.aspx.


2. Jose Luis left...
Wed 15 Nov 06 5:32 pm

I'm a novice programmer in C# and I bought three books, Murachs C# 2005, Accelerated C# 2005 and Agile Princiles to learn C#, Patterns, Agile metodologies, etc. If this book is not the corret choice for Patterns in C#. Can anybody give me some advice about a good book about that ? I'm reading now the Gof book, but I want a book about C# 2.0 and patterns in the real world, not only a theorical approach.

Thanks.


3. Craig left...
Wed 15 Nov 06 8:19 pm

I'd rather get a book without any C to be honest - I'm not big on stuff like this, I don't like coding for what-ifs, I like to see patterns emerge as I design for what I need.

any other books?


4. Kevin Hoffman left...
Thu 16 Nov 06 8:30 am

As I said in the blog, if you already know your C# cold - you can overlook the proliferation of C and the syntax errors and other dubious and false statements and skip to the patterns. However, those patterns are also available for free via google. Just hit wikipedia and put in the terms I mention in the blog and save your money and skip this book.


Tag Related Posts

NYC SharePoint Developer Needed

Mon 12 May 08 12:09 P GMT-05

My Review of Iron Man

Mon 05 May 08 12:33 P GMT-05

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Review : Transformers Movie (No Spoilers!!)

Wed 04 Jul 07 1:44 A GMT-05

I got on the endcap baby!

Sun 10 Jun 07 1:06 A GMT-05
tags:      

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

Will Silverlight be DOA?

Mon 16 Apr 07 8:02 P GMT-05

My Little Pony .NET Unleashed 2007

Fri 30 Mar 07 1:59 P GMT-05

An experience with the Leopard beta

Mon 26 Mar 07 7:45 P GMT-05
tags:                

Authorness

Thu 15 Mar 07 1:44 P GMT-05

ASP.NET vs Ruby on Rails : Round 2 (Agility)

Thu 05 Oct 06 11:02 A GMT-05
tags:                      

First Impressions of Windows Vista RC1

Thu 07 Sep 06 1:30 P GMT-05
tags:                      

My thoughts on the WWDC '06 Keynote

Thu 10 Aug 06 12:36 P GMT-05
tags:          

Review of Diigo

Wed 09 Aug 06 12:20 P GMT-05

Tech-Ed 2006 - Session Reviews

Tue 13 Jun 06 6:22 P GMT-05
tags:                    

PCS Phone Audiovox PPC-6700 (Sprint)

Tue 06 Jun 06 1:31 A GMT-05

Windows Vista Beta 2 - Day 2

Fri 26 May 06 11:50 A GMT-05
tags:            

Lambda Lambda Lambda

Sun 21 May 06 1:01 A GMT-05

The Adventures of LINQ (Not Zelda)

Fri 19 May 06 11:21 P GMT-05
tags: