Reflecting on Design Patterns

29 Nov 2023

Reflecting on Design Patterns

If you tackle it as it it, this concept in software engineering may be confusing. However, if you take a step back from Software Engineering and solely look at the words, "design patterns". It's clear what those two words are and you can develop a better image and fully understand what it is. Design;to create a drawing, and Pattern; something repeated. In essence, it is creating something to help with repeating the same issues. Sounds awfully similiar to a blueprint. You can see what the result and its features are, but the exact order of implementation is up to you. This is the same for any blueprints for cars, buildings, and roofs. Going back to software engineering, Design patterns are pretty much typical solution frameworks for commonly occuring problems in software design. Similarly, and the most easiest way to understand for myself and maybe for others is Math. It's pretty much the formula given to you to solve common questions, lke the most famous, pythagorean theorem. Not that confusing, right?

Intentionally using design patterns for my personal use was a thought that did not occur to me. It did pop up occasionally in code that I've written. Just an example of it's common use, I have been using it without my knowledge of Design Patterns. The one that I've used plenty of times in my adventure of coding, is the Factory Method. The factory method is an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created. I used it for creating 2-d shapes and their 3-d shapes which was defined by a superclass called Shapes. Another use was when I implemented a Toy Shop in which depending on the user it would send that specific information tied, whether it be a customer, a transaction, product, etc. There are many more design patterns that I've used but I mentioned the one I recalled plentifully.

Design patterns are typical solutions to common problems in software design. Each pattern is like a blueprint that you can customize to solve a particular design problem in your code. Each design pattern addresses a specific problem context and provides a well-defined solution that can be adapted and applied to various scenarios within software development. So, the next time you find yourself encountered with writing code, just remember the Pythagorean Theorem.