Summary

In this chapter we discussed ways in which we can structure our code to increase performance or mitigate incompatibilities between classes or create modular code.

The following table summarizes the structural design patterns:

Design pattern

Summary

The façade pattern

This provides a simple interface for the existing complex functionalities

The adapter pattern

This helps in communication between two incompatible existing classes

The bridge pattern

This helps in communication between two classes, which are under heavy modification

The composite pattern

This enables unified access to a part and part-whole hierarchy

The decorator pattern

This adds capabilities to an existing class without changing its behavior

The flyweight ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.