Design patterns

Solutions to common problems that look to save time. They are not finished solutions but a path that can be taken to get a faster start. They can be: Structural (Relationships between modules), Creational (Dealing with the creation of objects), and Behavioral (communication between entities).

  • Adapter (Structural): Modify interfaces to allow classes to work together.
  • Command (Behavioral): Make an object for requests. You can now treat requests in many different ways, like putting them in a queue.
  • Abstract Factory (Creational): Interface to create families of related objects without
    concrete classes.

Dofactory has many examples to see how these patterns can be used with real code. They still provide many diagrams that explain the concepts behind the patterns but seeing actual code helped me understand why design patterns are useful. What really made it click for me were the “real world use” examples, not because they seemed like a problem I would encounter but they allowed me to see what kind of problems design patterns can solve.

While the concept behind many of these patterns is very simple, a key problem for engineers is to know when each of them should be used, that’s why I found the concrete examples so useful. Choosing a pattern is a decision that will impact a project and many ways, so getting the best option will surely make things a lot easier.