As soon as I heard the words “design patterns”, my immediate thought was that this might be the way a computer scientist’s code is written in clean, organized lines, or how the program and/or application is visually appealing for the user. It came to me as a surprise that design patterns were actually solutions that were developed from frequent problems that were at some point presented to software engineers. The whole concept was more confusing than I had thought, and didn’t have a whole lot to do with the visual aspect or the aesthetics of an application or website. Even now as I am still trying to grasp my head around it, I realized how similar the concept seemed to people’s daily lives, the numerous problems that we encounter, and solutions we develop and implement.
Design Patterns are essentially the solutions developed from a constant series of trials and errors to improve functionality and performance in software. If seen from the standpoint of someone who is not a computer programmer, it might seem like the concept of design patterns is not only applied to software engineering, but also in our lives. Whenever people make mistakes, it is commonly seen as either a bad aspect or it is defined as an invaluable learning opportunity. The concept of “learning from one’s mistakes” can be correlated to design patterns. (Image retrieved here.)
Such an example can be how a college student takes on too many commitments in one semester, such as a credit overload, organization allegiances, tight work schedules, and still expects to maintain a healthy lifestyle. The student realizes their mistake in taking too many tasks in a short amount of time, so they try to lessen the load by removing organization commitments and tight work schedules, but they still keep the way too many credits in the following semesters. The intense credit overload leads to poor performance. With the experience in mind, the student has learned what works for them, and what doesn’t. In this case, taking too many credits is not practical. This student might then decide to explain to their friends why it is an unwise idea to take on such a large amount of credits, and soon, in that group of friends, the design pattern of limiting credits to take in a semester is formed to improve one’s performance.
I hadn’t realized I was using design patterns while programming until recently when the concept was introduced in the class. I hadn’t even realized that it was a common question asked at interviews. When I inspected it more, I understood that I have actually been using design patterns in most of my coding assignments since I started on this programming journey. Even in my ICS 314’s final group project, UH Code Submissions, there were design patterns used throughout. The observer design pattern was used when an object changes its state, and the other objects are notified and updated immediately and automatically. This is evident when a student registers for a new account, submits a problem, or modifies the data, such as editing a user or a problem. Furthermore, the singleton design pattern is an instance of class and/or object that can be used anywhere in a program, and in the final project’s case, it is the collections where we store the problems, and the contacts for the users and the admins.