Merl's Blog

Design Patterns

Let me set the scene for you.

It is Christmas time and you need to make cookies for your family. It just so happens that your family loves Gingerbread man cookies. So you need to make a huge batch with many different flavors and styles.

What do you do?

Well, sadly you are ignorant of any solutions so you must make them all by hand. You know that you must make many different flavors. But because you make each one by hand they all are shaped differently, some look great, others terrible and towards the end they stop looking like a person at all?

gingerman

What if you knew about cookie cutters? What if you were able to use a cookie cutter to help you and this gave you more time to focus on what you wanted, which was to decorate the cookies in the style that you wanted. Or go and nap!

gingerbreadcutter

gingermen

If you want to make many stars or hearts you can use the same strategy.

I bring up the analogy to bring out the benefits to the Design Patterns. These are tried and true solutions to common problems that arise in software.

If you are ignorant of them, you could be like my initial premise and have a hard time forming whatever design you want.

However, if you are away from the design patterns then you can use the correct one to help you solve the problem that you need.

Unlike an algorithm or Stack Overflow, you can’t just copy and paste the code. But you can make your code fit the blueprint provided. Not only that, you have the flexibility to arrange your software in your own style to help fix your problem. Like decorating the cookie in the manner that you want.

Lesson to be learned is that knowing your Design patterns will help you be a better developer because then you can solve your problems faster, and in a SOLID manner as well.

Best,

Merl