This blog contains reflections and thoughts on my work as a software engineer

torsdag den 23. oktober 2008

God Object

We've had problems lately in our Domain Model - it just isn't very easy to test and maintain so I researched a bit on the subject and found myself reading about God Object... Guess what I realized? We haven't followed the very basic principles of good OO design so we've ended up with a 1200+ lines of code long single class with 50+ methods which is responsible for everything happening in the M in our MVP triangle for some 20+ user stories implemented... High cohesion? I think not. Low coupling? I think not.

I've read a little further and found www.antipatterns.com/briefing also to be very informative about antipatterns in OO development. Right now I've got the hots for NDepend - my idea is that we need some kind of continuous feedback on our design and NDepend can give you feedback about cyclomatic complexity, lines of codes in your classes, number of methods in classes, the dependencies and relationships between classes and assemblies etc. etc. - and NDepend reports can be fully integrated in CruiseControl.NET which already is a cornerstone in our daily development cycle. I don't think a fullscale report on every piece of our current , non-tested, 5 year old code will do us any good - I actually don't think I dare doing it at all ;o) - but in our new projects to come I think NDepend could help us by flashing a warning sign when and where software entropy begins in our software. This feedback will enable us to reevaluate our design based on reports on the current state of our code and hopefully we'll be able to see antipatterns emerge in our design sooner.

Regards Kristian

Ingen kommentarer: