Code Samples: Are They Ever Right?

by scott.rudy on 07-01-2011 08:20 AM - last edited on 07-01-2011 08:32 AM

Another Microsoft .Net code example has been taking some criticism as of late. I read some blog posts and the cooresponding comments from a couple of well known and respected developers, Ayende and Rob, and I think they are being a bit harsh on the example set. To be fair, many of their points would actually be valid if they were looking at an enterprise application. However, in this case I feel they are taking this code out of its context.

 

The requirements for this solution are to show architectures and patterns. I feel the solution does that when you review it within the context of the book, N Layered Domain Oriented Architecture Guide with .Net 4.0, which both bloggers did not originally reference in their posts (possibly because they were unaware of it).

 

The intentions of the book and the code samples are to provide guidance and some examples around how patterns "can" be implemented. It is not the intention to show how to properly do DDD or to document how a bank runs it business. There are plenty of books out there that can do those things. I don't think the authors are expecting anyone to open up the project and refactor it into their own application (although I am sure there will be some that try).

 

It takes a good bit of experience and knowledge to know when you might need a pattern. I really appreciate the work these guys have done in trying to provide some guidance around the complex enterprise patterns that are being pushed out of many blogs.

 

 

   

We encourage you to share your comments on this post. Comments are moderated and will be reviewed and posted as promptly as possible during regular business hours.

To ensure your comment is published, please follow our community guidelines.

Comments
by Harshad(anon) on 09-17-2011 12:56 PM

Great post. Thanks for posting this.

Post a Comment
Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.

Find HP in Social Media

Facebook Twitter YouTube SlideShare Flickr
About the Author
Labels