Design patterns

what are design patterns?

Let's start by defining design patterns. All this talk these days, but what are they really? Well, simply put, design patterns are solutions to common problems in software design. To avoid solving the same problems over and over again in different ways, we (the software community) have created a set of common patterns to help us. These patterns are rough blueprints which have some amount of flexibility built in so you can apply them to your usecase and/or combine them as necessary.

why should I use them?

Now for the bigger question, they are useful, I get it, but why should I use them? Well, if you are building a solution for FizzBuzz which you are going to throw away five minutes later, you probably dont need design patterns. But if you are going to build something which you'll have to extend tomorrow, ship and maintain for years to come, it's a good idea to throw in some design patterns to keep it maintainable, extensible and robust.

Design patterns are less about the functional side of things, they are not algorithmically intense recipies for solving problems, but rather a question of form and style.

what are some common design patterns?

Here are some frequently used design patterns which you might have already heard of:

  1. factory
  2. singleton
  3. facade
  4. decorator
  5. iterator
  6. adaptor

If none of these ring a bell don't worry about it, we'll cover them in another post.

Share something about this post.