Design Patterns are Very Efficient

03 Dec 2020

Before taking the software engineering course ICS 314 at the University of Hawaii at Manoa, I was not familiar with any of the concepts of software engineering, those concepts including design patterns. In this class, I’ve learned about many of the concepts of software engineering, and now that we are actually building an application ourselves, design patterns seem a very important concept to be aware of.

Design Patters Make Your Code More Efficient

Often when you are coding, you will have certain problems that repeat themselves. While it may work to not use any design patterns in your code, this is not the most efficient way to do it. It will take a long time to figure everything out. Design patterns are there to help you out! Design patterns are the an abstract core of the solutions to those problems that keep occuring over and over again. By using design patterns, you can use this abstract solution to those probolems over and over again, and thus code way more efficiently. By making use of design patterns, you set yourself up to code in a more professional way.

Helping Out Newbies

When I was first introduced to Javascript in a software engineering course, I was very overwhelmed. I saw real products that software engineers made, and wondered how I would ever get to that point. As I am writing this, we are at the end of the semester and currently working on the final project for this class, in which we have to build a functional website. At the beginning of the semester, as I read through the schedule, this project really stressed me out. I knew, at that point, that I didn’t have any knowledge yet for this project. I was anxious as to how we were supposed to learn all those skills in a couple of months. Well, here we are at the end of the semester, currently working on the final project, and it has been going good so far. A huge help in this have been design patterns.

Products Build by Experts

These solutions, design patterns, that have been found by the experts after running into problems over and over again, help us newbies create professional websites or products. The experts that have created these design patters allow us newbies to create products seem like they were build by experts.

Publish-Subscribe Design Pattern

The design pattern that has stood out to me the most, and that we are using a lot in our final project, is the Publish-Subscribe (also known as pub/sub) design pattern. This desgin pattern is very useful for exchanging messages between the publisher and the subscriber. The Publish-Subscribe design pattern is a messaging pattern where publishers, the senders of messages, categorize messages into classes without knowledge of which subscribes, if any, there may be.

Usage in Final Project

In our final project, we make use of this pattern because we have items on our site that can be edited and the details can be changed. By using the Publish-Subscribe pattern, we can very easily implement that everyone who wants to know about the state of the item, and thus the parts where the item is displayed, will get updated if the item has been changed.

Many More Powerful Design Patterns

Besides the Publish-Subscribe design pattern, there are way more design patterns that will help you code efficiently and give your code a professional feel and your product a professional look. I highly recommend to anyone wanting to learn more about software engineering to take the time to learn about design patterns, because it definitely pays of in the end.

Conclusion

Thus, design patters are abstract solutions to problems that are occuring over and over again. These solutions are frameworks to solve such problems, they are not detailed code that you can just copy and paste, but instead you have to adapt the framework to your own code. They have been proven to be very powerful, and we are making use of them in our final project. The Publish-Subscribe design pattern is a design pattern that we are making use of in our final project, and it is a very helpful framework to exchange messages between publishers and subscribers.