I'm Seeing a Pattern

29 Apr 2021

Reduce, Reuse, ReCycle

When you want to create anything, the easiest part is identifying the desired functionality since there is an intended purpose. Unfortunately, there is more than one step to the creative process, and all of the intermediate steps are more challenging. In computer science, the first step of the creative process is choosing a design pattern, which is a general approach to solve a variety of problems.

To understand design patterns more than a vague definition, an analogy about art would be the best. The primary purpose of art is to create a tangible product that conveys something to its audience. However, there are a variety of methods available to an artist: pencils, watercolors, or recycled goods. Each option has its advantages and disadvantages specific to your project. Therefore, nothing is off the table, so the choice depends on your mentality. Design patterns create the foundation so you, the software engineer, may produce the best product with your unique spin.

Oh! That was a Pattern

The term "design pattern" is always mentioned, but briefly in which one assumes they know its meaning. I always thought I never used it, but I realized that there were instances in which design patterns were in my code.

The most prevalent use of a specific design pattern in my code was the singleton pattern. During my sophomore year in high school, my brother and I developed a baseball game using C++. We created, imported, and exported classes of the various objects. In addition, I am currently using a singleton pattern in my ICS 314: Software Engineering final project. By creating and exporting an instance of object collections, the data can be displayed or edited. Both of these are instances of the singleton pattern.

The primary pattern used in my ICS 314: Software Engineering final project is the model view controller pattern. There are four components of the model view controller pattern: model, view, controller, and user. The Javascript library, React, manages what the user sees and the database contains by handling the view and controller aspect of the pattern inside the same file. Then MongoDB serves as the model that holds the data. The device used and the subsequent webpage completes the system and allows the user to use and edit the data.

Conclusion

In software engineering, understanding and implementing design patterns is crucial. The fact that I was using design patterns without knowing what the word meant demonstrates its necessity. After a little bit of research, it is evident that there are many different types of design patterns. To make the creative process be more efficient and timely, it is necessary to acknowledge and implement other design patterns when it is best suited.