Summary

This chapter extended the design patterns we started to learn in the previous chapter by introducing structural design patterns.

To this end, we learned some critical patterns to ease the software design process; these patterns identify a simple way to realize the relationships between different entities:

  • We learned about the Decorator, how to wrap classes to add additional behavior to them, and critically, we learned how this can help us comply with the Single Responsibility Principle.
  • We learned about Class and Object Adapters, and the difference between them. The critical takeaway here is the arguments for why we may choose composition over inheritance.
  • We reviewed the FlyWeight design pattern, which can help us perform certain processes ...

Get Mastering PHP Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.