GofPatterns Gofpatterns  





Structural Patterns  «Prev  Next»
Lesson 3 How do structural patterns help programmers?
ObjectiveSee what structural patterns can do for you.

How do Structural Patterns help Programmers?

Structural patterns include some quite sophisticated and powerful techniques. However, they are based on just a few basic techniques, primarily:
  1. Delegation: The pattern is one in which a given object provides an interface to a set of operations. However, the actual work for those operations is performed by one or more other objects.
  2. Object composition: Other objects are stored as pointers or references inside the object that provides the interface to clients. Object composition is a powerful yet often overlooked tool in the OOP programmer's toolbox. Structural patterns show you how to take advantage of it.


Benefits

Structural patterns have many beneficial effects including:
  1. Increased efficiency (Decorator, Flyweight, Proxy)
  2. Enhanced reusability (Adapter, Bridge, Decorator)
  3. Separating implementation from interface (Adapter, Bridge, Façade, Proxy)
  4. Reducing complexity by providing cleaner, simpler interfaces to a system that are easier for client programmers to understand (Adapter, Bridge, Composite, Facade, Proxy)
In the next lesson, you will become familiar with the structural patterns introduced here.