Design Pattern Gingerbread Cookies

05 Dec 2017

It’s December!

Which means that it is Christmas season! People all are decorating and stores have their seasonal items. December is the month that when the season is the strongest. It will only be right that I make this essay related to the season. I will be going over what I have been learning about recently and it surprised me.

Surpise! Design Patterns and Why They Surpised me

The thing that I’ve been learning about was design patterns. When I first read the term design pattern I thought I didn’t know anything about them, but apparently I’ve been using them for majority of my programming experience. Design patterns are basically templates that are used for problems that happen regularly. They make programming easier, especially for those who are newer to it and don’t know how to solve some problems. To explain what they are easier I will use gingerbread cookies.

Gingerbread Cookies

Imagine a plain gingerbread man cookie or gingerbread house. It’s all plain, just the cookie parts and no frosting or toppings. That would be the base of a design pattern. It’s the foundation, the general form of a how to deal with a problem. Now if you were given a gingerbread cookie, you can apply frosting or other toppings and make it like how you want it. Others can do the same with cookies that they were given but instead they can do a different design. This is how people can take the same design pattern but adjust it differently to fit what they want. You can even show your cookie to other people so they can try design their cookie like yours.

Some of my Cookies

Some of the design pattern gingerbread cookies that I have made are like the classes in Java. Before you get a gingerbread man cookie you need to have a cookie class. But what if you didn’t want a gingerbread man but a gingerbread deer? That’s where the generic cookie class would come in. All the different shapes that a gingerbread cookie can be will be derived from a gingerbread cookie class because they are all cookies. The generic class gets turned into a more specific case of the class.

Happy Holidays

This concludes my little explaination of how I interpret design patterns. In a summary you use a premade solution of a generic problem to help you solve a specific problem. It makes programming easier and faster. There are many more that you probably have been using without even knowing it so go research the rest.