Recipes for Software Engineers

27 Apr 2019

In life we are constantly facing new challenges and our job is to overcome them. Practice makes a perfect solution to a new concept, but repetition is exponentially inefficient over time as one develops their capabilities. Eventually, solving a problem that you are familiar with becomes muscle memory. Despite it being trivial, solving a familiar problem may still take time. As usual, us humans have figured out a way to streamline this process by reusing a previous known solution instead of starting from scratch every time. This method is known as, design patterns. Design patterns are used by software engineers like how chefs use recipes. Recipes are designed to be reused to prevent subtle and/or major changes to the dish that can create problems. These recipes can be used by different chefs and even amateurs to replicate the same dish or make improvements to it.

The Big Three

Design patterns are templates catered towards commonly occuring problems and can be modified lightly to suit your variation of the problem. These templates are classified into three major categories: creational design patterns, structural design patterns, and behavioral design patterns.

Creational Patterns

Creational design patterns deal with object creation and attempts to create objects in a manner suitable to the situation. The default form of object creation usually results in design problems or added complexity to the design. Creational design patterns resolves these issues by controlling the object creation.




Structural Patterns

Structural patterns are design patterns that identify a simple way to discover relationships between entities. For example, when a class functions as an interface to something else, such as a network connection, a file, or any other expensive resource.

Behavioral Patterns

Behavioral patterns are patterns used to identify common communication patterns between objects and notes these patterns. With this design pattern, it increases the flexibility when initializing this communication. For example, iterators that are used to access elements in an aggregate object.

These patterns allow software developers to understand the thought proccess behind design pattern based solutions and more often than not, these developers probably used similar or maybe even the same pattern allowing them to relate the presented solution to their own to a certain extent. However, design patterns can not necessarily be improved like how a recipe can be improved. A chef can improve the taste of a recipe, but as a software engineer, you can’t always improve a design pattern such as the React Javascript library. It is something built in that may be out of reach for consumers of the product.

The Presence of Design Patterns

Design patterns are present almost everywhere in the software engineering world. The React Javascript library is a great example of a library that utilizes basic design patterns such as the observer, mediator, iterator, abstract factory, and much more. The Semantic UI framework also acts as a design pattern because it provides an initial template of ui code that you can modify to satisfy your needs. The project I am working on for my ICS 314 class, Ono Manoa Grindz utilizes design patterns from open sourced communities and digits. The project utilizes React JS and Semantic UI which allowed me to find quick solutions to problems with the libraries these design patterns provide. For example, when I wanted to look for different variations of a card ui, I looked it up on the Semantic UI library and got a list of all card variations they provide. Design patterns are useful for software engineers, but this concept can easily be applied to everyday life in not only a “recipes and chefs” fashion.

You can improve your own life by having an ease of access to solutions to everyday problems. A great example is having a set schedule for when you go to the gym and what you do at the gym. If you create a schedule of what you do at the gym on what day, you can save time from choosing exercises in the moment and overall be efficient at the gym by not improvising.