Tuesday, June 10, 2008

Daily Links 10/06/2008

Synch google calendar with outlook
$30 / year price tag :|

Upgrading to Silverlight Tools Beta 2 and Visual Studio 2008 SP1 Beta

Fixes for Silverlight 2 Beta 2 install / Visual Studio hassles

DocProject 1.11.0 RC
Works with SandCastle May Release (when it gets released)

MSDN Code Gallery
Handy for keeping up to date with code / utilities available for M$ software development products

Good article on using mock objects in unit testing

GhostDoc
Auto-generate xml documentation in C# code based on method name and paramters via a short-cut key. What I found really nice was that if you change the parameters / names etc., and press the short-cut key, it automatically corrects the xml documentation above the method definition. It also allows you to add custom rules to make the generation more intelligent.
Use this in conjunction with DocProject & Sandcastle, and you have a comprhensive code documentation system that has minimal impact on the productivity of the development team :)

I've come across some justifying leaving debug="true" in their asp.net web.config files for detail error message reasons. Here's why you shouldn't

Mobile Phone: XML Contacts Backup
"Useful for export, modify and re-import mass contacts files. XML Contacts Backup has nice interface very friendly and easy to use. It's always good to have your contacts backed up, why not in XML format for better accessibility and editing"

Monday, June 2, 2008

Daily Links 02/06/2008

free icons

programmer's bill of rights
old post, but still relevant

Announcing the release of Microsoft Source Analysis for C#
"his tool is known internally within Microsoft as StyleCop, and has been used for many years now to help teams enforce a common set of best practices for layout, readability, maintainability, and documentation of C# source code"
although if you have Resharper, you already have access to all of this functionality
HowTo: Configure Microsoft Source Analysis

Resharper was moaning at me for declaring a loop scope variable before the loop (old C++ practice), so I hunted around as to why (doesn't declaring a variable inside a loop impact performance?)
Found this article: basically, declared inside or out, the same IL is generated under the hood (because variables are passed in the method header) - so it's better to declare inside the loop, for readability and scope reasons.

SQL Server Programming Hacks

Silverlight links post

Thursday, May 22, 2008

Domain Driven Design: The 3 Rules of Inheritance

imo one of the core success factors of a software development project is the initial design of the Object Model. This needs to be done right as soon as possible (which implies inclusion of strong business / systems analysts - but that's for another discussion), because changes to the model after implementation begins has serious consequences to the project time-line (and the budget)

One of the core design "anti-patterns" that I have been witness to, has been the over-zealous employment of inheritance in the model, which results in a complex design, which takes longer to implement, which creates havoc when a change is required (and it will be required - rarely is the object domain fully understood the first time round)

Hence follows a guide on inheritance which should be followed during the design process:
Only inherit when:
1) The derived object introduces new attributes - properties
2) The derived object introduces new behaviour - methods
3) The derived object introduces new relationships with other objects - which really is just a variation of 1) and implies the necessity of 2)

ie: an object "dog" can be of type "poodle" and "greyhound", but that does not justify adding a derived object for every type of dog if they do not satisfy the above rules - an over-simplification, but I have seen this done time and again in the business arena to the detriment of the software development effort.

If logic needs to be executed which depends on the specific "type", and none of the above rules are true, then type needs to be an attribute on the object, not a specialized type. This way, when types get added / removed after implementation, there is no need to change the model.

So don't be caught only using the "is-a-kind-of" guideline for inheritance - it can lead you down a very timely and expensive path.

Now, keeping the above in mind, go and read more on what inheritance is all about.