Design: Don’t Repeat Yourself (DRY) Principle
September 7, 2008
Avoid duplicate code by abstracting out things that are common and placing those things in a single location…
…and also doing it in a way that won’t create more problems down the lines. Rater that just tossing code that apperas more than once in a single class, you need make sure each piece of information and behavior in your system has a single, clear place where it exists. Your system always know exactly where to go when it needs information or behavior,.
DRY is about having each piece of information and behavior in your system in a single, sensible place.
Advertisement