Wednesday, June 27, 2012

Applying design patterns to SOLID design. Keep an eye on KISS and YAGNI !!! Part 1


I will start writing a series of articles about S.O.L.I.D design and how to achieve it by using design patterns, I will not only focus on theory but I will give some examples and code to try to explain the problem that each principle of SOLID design is trying to solve and how to implement the solution using design patterns.

I have noticed that the problem with design patterns is not to understand them but most importantly when and how to use them in order to get a low coupled maintainable and reusable software. Many programmers (not only juniors) use design patterns just to use them because of the buzz words around them and because they have been told that it is a good practice to use them. But like any good practice if it is misused or/and misunderstood will cause problems instead of resolving them.
In case of misusing design patterns usually we end up with a more complex and over engineered solution, this conducts us to two other software design principles that we should be aware of, KISS and YAGNI.

YAGNI acronym for” You Are Not Gonna Need It”, usually applying the solid design principle and the use of design patterns means adding levels of abstractions and complex objects. Using the right pattern for the right job is important, otherwise we will end up with an over enginnered solution hard to understand and maintain with more lines of code and of course more bugs.

KISS: “Keep it simple stupid” always simple solutions are the best one don’t over complicate things by doing too much or an infinite loop of “what if”. 

That is enough for today i will develop more these principles and give some code examples in a later posts where i will show how to apply all these principles within a TDD process.

To be continued .... ;)






0 comments :

Post a Comment