There's a Pattern

29 Nov 2023

Introduction

Design patterns are similar to a blueprint of a building. In a building, there are various rooms / spaces with different purposes, functionality and aesthetic. The spaces may be different, but they still add to the buildings architecture to make it whole. Similarly, in software engineering, there are different design patterns we can use to solve problems in our applications and projects. Multiple design patterns can be used in a single application / project (similar to how there are many spaces in a building). Design patterns act as the blueprint of an application, not the building itself. They are used as an outline to create a well-structured, maintainable and adaptable application. It is our jobs, the software engineers, to add our own “pizzazz” to the design patterns make the application our own and unique.

My use of Design Patterns

During my time writing code for the final project, I have been using design patterns without knowing. The meteor-application template that we used for the final project uses design patterns, such as the Model-View-Controller (MVC) pattern and the publish-subscribe pattern. Since we used the template, these design patterns were also used in our final project application. An example of I’ve used MVC in the final project was when I created projects. The schema for the projects acted as the model, the project pages the user sees is the view and the methods to add and edit a project acted as the controller. The publish-subscribe pattern is used to inure that companies, projects and cables owned by the user are accessible to the user, if they don’t own them, they won’t be able to see them. Other design patterns that I’ve found in our project is the module pattern and component pattern. My team has used the module pattern while creating schemas, navigation routes and roles for our application. To make routes shorter, we created an object for the path that leads to the page. Instead of typing the entire path, the object can be used in place for the route. The object can be imported to different files, making it easier create links to other pages. We used the component pattern to create reusable components for our application, in case we want to combine different components together on a certain page. I think that design patterns can be very useful in creating an application, I wish I knew about it before I started the final project.