The Untold Lesson

29 Nov 2018

Building Blocks

Whilst coding, you will eventually run into problems that will commonly occur into your code. The way I think of deisng patterns is similar to how building blocks like legos work. Lets say that you get a themed set of legos from the store. Your problem is to build the the structure with planned inside the set. This set will represent the design pattern as it is easily solvable through the set of instructions that came with the set. The set of instructions and legos will be the design pattern as it is the easy solution. Not using the blocks that came with set or using the instructions is a very inconvenient and inefficient way to build that lego set. That lego Star Wars Millenium Falcon does not have those green blocks or looks like reactangle block, which is why its more efficient and easier using a preset of legos and instructions to build such a master piece. So rather than creating some sort of your own design that is most likely not as efficient as an already defined design pattern to your coding problem, you should use a design pattern that matches the problem you have. These design patterns make it easier by becoming the template to the solution of your problems in which can be further built upon to your needs.

Unknowingly Learning About Design Patterns

Throughout my years of learning how to code, I did not learn the design patterns I know now as design patterns. In Java, it was taught as regular Object Oriented Programming. The design pattern that was taught was called Prototype in which inheritance is taught or even polymophism. In ICS 211 we programmed a beer distillery that worked similar to what would be called a protype of beers. Unknowingly, I used a factory design pattern for this class. For my current class, ICS 314, I’ve apparently used quite a bit of design patterns pertaining to the meteor app, both from HACC and the final group project. Such design patterns would be the Publish-Subscribe, Reactive data and Model-View-Control. These design patterns fall under a general design called the Observer design pattern.