Tuesday, September 25, 2012

SOLID advice from Telerik

The Telerik Blogs - Why SOLID Matters

One of the biggest struggles that developers have with adopting Unit Testing, whether it’s Test Driven Development (TDD), Behavior Driven Development (BDD) or even just Test Eventual Development (TED), is the difficulty some code is to test.  This is typically when code doesn’t follow the SOLID design principals. If you aren’t familiar with Robert C. Martin’s SOLID Principles, here is a quick summary.


There are five SOLID principals put forth by Robert (Uncle Bob) C. Martin.

...

Let’s talk about how SOLID can help make the day in the life of a .NET developer better.

...

UMMARY

What have we accomplished?  We changed our code so that it only does the one thing that is it supposed to, we removed the concrete implementation, and we injected our dependencies.  The code is still clean and concise, and pretty much the same number of lines that we had before the refactoring.

We are no longer dependent on the LoginService being implemented before we can test our code, get it checked in, and move on to the next feature request. We can test this code to make sure that it behaves as we expect, knowing that the dependencies won’t occlude the results.

Happy Coding!

image..."

While there's some Telerik stuff in this post, stating how their tools help in a given situation, it wasn't overly much and the great style and content outweighed the plugs my miles. We've all heard of SOILD, but the way Philip explains it in this article, with good examples and how it applies to the .Net Dev makes this article a keeper...

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...