An Introduction to Design Patterns

Complete Developer Podcast - En podcast af BJ Burns and Will Gant - Torsdage

Kategorier:

In this episode Will and BJ begin a four part series on design patterns. This week they introduce design patterns giving a brief history and overview of the different sets of patterns. In the subsequent episodes they will be discussing each of the three sets of patterns. “In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design.” ~ sourcemaking.com Design patterns are a way of thinking about abstract concepts in Object-Oriented Programming. In the original book 23 patterns were listed divided into three sets of patterns: Creational, Structural, and Behavioral. Will and BJ discuss both the benefits and some of the critiques of using design patterns when designing and developing code. Episode Breakdown * 15:13 Gang of Four “These are fundamental elements of how you design software” The Gang of Four refers to the four authors (Gamma, Helm, Johnson, and Vlissides) that wrote the original book: Design Patterns – Elements of Reusable Object-Oriented Software. For the book they took ideas from the architectural community. The basis for design patterns is to program to an interface not an implementation favoring object composition over inheritance. Gall’s Law states that all complex working systems evolved from simpler working systems. Design patterns are Gall’s Law put into practice within the development world. They are not “theological” constructs but developed out of simpler designs that worked and are repeatable. * 17:58 Usage of Design Patterns Design patterns create a common language platform for developers no matter their preferred language to communicate and develop best practices. BJ and Will as .NET developers are able to discuss the same concepts with Ruby or Python developer friends. * 19:53 Benefits of Design Patterns Design patterns are tested and proven paradigms that speed up the process of development. They have stood the test of time and actually work in practice as opposed to working in academia. They are general solutions that standardize communication between developers no matter the language they use. * 22:52 Types of Design Patterns Creational “It’s a way of abstracting the creation to deal with it the same way you deal with everything else” Creational patterns have to do with the instantiation mechanisms. They are used to make creating objects easier. Instead of every consumer of a class having to build an object from scratch they can request it. Structural “You don’t want to play Operation with your design.” Structural patterns relate to the relationships between objects or entities. They make it easier for entities to work together. They allow for an intermediate between two objects communicating so that each individual object doesn’t have to know the details of the other. This allows for interchangable code. Behavioral Behavioral patterns deal with the communication between objects or entities. They make communication easier and more flexible. * 32:52 Critiques of Design Patterns There are many, many, many critiques of design patterns. This is by far not an exhaustive list, one doesn’t exist to our knowledge. These are some of the more prominent critiques. * Targets the Wrong Problem The need arises from using languages with insufficient abstractions and many patterns are not needed depending on the language. Using the wrong pattern to solve one problem because it is more apparent but less effective. * Lacks Formal Foundations There is a critique primarily from academia that this was an ad hoc study. These patterns are ones that were recognized in reusable code not scientifically formu...

Visit the podcast's native language site