URL: https://www.codingblocks.net/podcast/episode-11-design-patterns-part-1-you-create-me/
Design patterns, specifically Creational Design Patterns. That is what my podcast for this week is about. Design Patterns can be split up into four sections: Creational, Structural, Behavioral and Concurrency. From each of these Design Patterns, there are different types. Structural Patterns include adaptors, bridges, flyweights, facades, and proxy’s. An observer, strategy, and Chain of Responsibility go along with Behavioral. Concurrency carry Blockchain, Scheduler, and frameworks. Last but not least, Creational holds Factories, prototypes, builders, and singletons. All of these part of Design Patterns are crucial to learn and understand if you want to become a better program, which was my main reason for watching this.
Now to get more in depth on the types of Creational Design Patterns, getting a rough understanding of Design Patterns first needs to be figured out. In this podcast, one of the speakers state's first, “When I see the word factory in a code base after snickering to myself, I know what that class does, what to expect when I open that file, same thing when I see a builder, adaptor, visitor. They have meaning which allows me to shortcut reading those files, and comprehend what’s going on at a higher level”. They are used to help programmers solve a common problem by creating and designing these applications or systems. Creational Design Patterns help make a system independent on how objects are created, composed and represented.
There are many more types of Creational Design patterns, but for this podcast, Factory, Builders, Prototype and & Singleton’s were all roughly talked about. Factory was the first of the four, which was in my opinion, the hardest to understand. With Factory, it can be split up into different parts: Factories, Factory methods, and Factory patterns. From there Simple Factories were talked about, and Abstract Factory patterns. Then at the end they mentioned the pros and the cons. The pro’s being that is adheres to the open-close principle and that they can be used with inputs, mostly switch statements. The cons were that it uses but mostly can use reflection quite a bit and that it can be extremely complex.
Builders were next, which are more about having the caller put together the objects. While factories really know how to put together the object, the builder on the other hand does not really know what the user wants the object to look like. The pros of builder was that it is a great way to build complex objects and has an elegant feel to it. The cons to it were that it can be a bit more verbose and that it is like adding an ingredient one at a time and can take some time. Prototypes were talked about very shortly which is where one creates a new object by cloning the existing object at runtime. Lastly, Singletons were talked about, which is a single instance of a class, the class that restricts the instantiation of a class to only one object. The downside for this was that decisions have to be made right then and there.
I was really excited to hear this podcast for a number of reasons. One being that, now that I have learned most of the basics of coding, it is really interesting to now learn about the different designs and learn new ways that will help me become a better coder and programmer. This exactly what I have been learning in one of my classes at the moment, but there is only so much time that can be discussed on the topic. This podcast helps me comprehend a deeper understanding of these design patterns and will of course help me in the future on a number of different coding projects I will be given in whether that be class, internships or professional job. It is as always so easy to understand these guys and I cannot wait to listen to their other podcasts about the other topics.