Today, software is what powers the many functionalities we rely on today in our daily lives. Every day, current software gets updated and new innovations are made. While these breakthroughs can be great achievements, regardless of whether its a small change in current software or the birth of new software, sometimes these creations can often lead to problems.
To combat some of the challenges that arise during the software development project, software engineers would follow the concept of using design patterns. The concept of design patterns does not merely apply to the realm of software engineering, as such concept exists in many situations, such as following a recipe to a dish to be cooked in the kitchen.
When we would like to cook something, we often would follow a recipe: a set of instructions laid out to help prepare a dish using a set amount of ingredients. Some recipes will take you just through the steps up until you get the final product, while other recipes would break down the dish into separate components then have you put all the components together at the end. Sometimes a recipe would have components to its dish that would require another recipe, such as a recipe on how to bake a loaf of bread in order to have some bread to use for a sandwich. All of these instructions were tested beforehand to ensure both consistent and tasty results in the end, so that no confusions or other issues arise should all the ingredients and equipment be present. These instructions are also present to better help cooks prepare the parts of their various components beforehand before diving into the process of putting it all together. Having everything ready and prepared before cooking is often called “Mise en Place.”
Just like recipes, design patterns in software engineering are just like that. To help prevent the emergence of new issues while also fostering to the growth and expansion of software both new and current, software engineering follows design patterns: reusable solutions to common problems that occur during the software development process. This can also be thought of as putting together well-crafted and tested solutions to create an innovative and dependable piece of software. It can be thought of as creating various components of code that will accomplish solving reoccurring issues or needs that arise during the software development process. Those components are then tested enough to ensure it performs well in all cases that it will be used in. When there comes a need to create something new, rather than having to “reinvent the wheel” and code up everything from scratch, there are already crafted and tested component solutions that can be used and put together with the new product without much of a worry for new issues to arise.
When I look back at the use of design patterns in trying to see how I’ve used it and perhaps how others use, it turns out that this concept is evident and well-used quite a lot in the kitchen. Not only does a cooking recipe breakdown a dish into components and provide you the steps on how to put it together to get the tasty product at the end, it also structures the kitchen into how the dish will be prepared should it be served during service at a restaurant.
Take the TV show Hell’s Kitchen for instance, they use design patterns quite often in the context of a recipe. Before dinner service, each of the competing chefs are given the same recipes to the dishes that will be served and are expected to study it, meaning they need to study all the various components that make the dish and learn how to prepare each of those components. Then, when it comes time for the services, rather than all the chefs individually going through all the motions of preparing each component and cooking the same dishes, the entire team of chefs are all assigned to work on one component instead. In this show, each chef would be assigned to work a various station such as meat, fish, garnish, appetizer, and dessert. Each chef assigned to their station would cook up the components of the dish then bring it up to be checked for quality then assembled at the pass by an executive or sous chef. Doing this allows for consistency throughout all the dishes being sent out, and if one component lacks, it can be easily identified which station needs improvement.
Similar to the structure of Hell’s Kitchen using design patterns, I’ve also used design patterns in a similar structure as part of my software engineering experiences. Throughout the course of my learning, many of the various projects I worked on slowly picked up on the concepts of designing by components. Like a food dish, a software application can be broken down into components. Each individual component would only make up a part of a new piece of software, yet they can be used flexibly to account for reoccurring issues in a piece of software or be used in new pieces of software.
For the final project, I’ve used design patterns in trying to put together the application my group and I are working on. Our software is a web application, which on its own is a lot since in web applications, a lot of effort needs to be put in on both how it works and how it looks. However, such application can be broken down into two parts: the front-end and the back-end. Then, from those parts, they can be broken down even further. For instance, the front-end can be broken down into what pages the web application will have, and then from each of those pages, components can be made so that it can be used flexibly among all the web pages. In our case, we had components for the background of our webpage, the nav bar, etc. My role handled more of the back-end work, specifically the database components to our back-end. Those components would be the schemas used to take in input from the application users to be stored into the application’s database. I put together most of the schemas based on the needs of this application. Each of those schemas could be used flexibly among all the web pages to take in user input to store into the database. At the same time, working on the database schemas as a component of its own allows for it to be tested. Should something go wrong, such as for instance, mismatching data types in an input form, the source of the error can easily be pinpointed. In the end of all of this, the various database components that I worked on will be implemented and put together with all the other components my teammates have worked on to create our web application.
Design patterns are such a great concept to follow not only in software engineering, but in many other applications as well. Its characteristics of breaking things down into components that can be crafted, refined, and tested allows for great flexibility in its usage, and also for scalability as these components can be put together to create something new and innovative while reducing the risk of new issues arising in the development process.