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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.