Design Patterns and Desktops

03 Dec 2020

About 90 minutes ago, I was introduced with a new topic called “Design Patterns” in Software Engineering. In all honesty it was a little rough for me to understand what it actually meant. But this is how I visualize a type of design pattern: Building a brand new desktop gaming computer. Earlier this year I had the opportunity to build my first ever desktop computer. It required a lot of deciding on what components I wanted and how they will benefit my production in work and play. Building a new PC is kind of like a form of Design Patterns because it requires us to seek for the best and most optimized for our own budget. The decision on what component you want to buy has to satisfy and work with every other component. This is like how in Object Oriented Design Patterns require some sort of interaction between different classes. The analogy between building a PC and Design Pattern is that they all hope to achieve one goal; to find the best and most efficient solution.

There are many different types of design patterns that can be used for our own advantage. But the four most common are Factory, Single, Observer, and MVC. These design patterns will have their own list of advantages and disadvantages. Just like how you build a PC, one component may be better than the other but it can also be way too expensive. All these design patterns require a lot of understanding because you might be using the wrong type which in return can display many more problems.

I used a design pattern??

For all computer scientists, we have worked with a design pattern whether you like it or not. This actually surprised me because of the fact that we wrote huge amounts of code without knowing that we’ve used a design pattern. A more recent example of a project that I am currently working on with my group, would be our final project for my Software Engineering class called “Manoa Eats” (soon to be published under my projects collection for you to view). Our final project uses the design pattern of MVC, Model-Viewing-Controller. Where our controller would be the startup folder in the app/imports directory. The view would be our layouts folder in the ui folder. And our model would be the components and pages folder. Most of the time will be done under Model, where all the code that we would need to write will be there so that our application will run correctly. I’ve been coding for about 3 years now, and when I think about what design patterns have been used through projects,assignments, and tests in the past, I noticed that we would use the factory design pattern. I feel like “Factory” is a more formal and simple design pattern for most intro level class that I have taken because it required the use of OO (Object Oriented) pogramming to design and optimize our code.

If you realize it or not

Now that I have basic understanding about what Design Patterns are, I think it would be interesting if I kept them in mind in the future when I code bigger and more complex programs. The fact that we would need to know a topic like Design Patterns for future jobs/work, it changes my perception of how code can be implemented in softwares.