Design patterns: Structural Patterns

This is the second part of desing patterns, but this time we are going to talk about some some Structural Patterns:

Adapter Design Pattern: This Structural pattern is responsable for matching interfaces between different classes , in other words it adapts incopatible and make it compatible and working together.

As you can see in the UML diagram above the interface WisardAdapter works as adapter for the fighter interface and the wizard class, you can see an very detailed implemented explanation in this video.

Bridge Design Pattern:  in this design pattern You’re decoupling the abstraction from the implementation. You can progressively add functionality without affecting the others. You can see this in the UML example below

A good word to define this process could be split but without afecting. I hightly recomend this very good explained implementation of this design pattern by Derek Banas in this video.

Decorator Design Pattern: There’s a base class and you can use another class to layer on top of it on runtime.

you also can see its implementation in this video.

Facade Design Pattern: This structural pattern hides the inner workings, only shows you what you need to know/result. The facade object calls and manages all the processes that are needed to perform a task

As you can see in the UML diagram, facade design pattern uses the principle of abstraction, you can see its implementation here.

Leave a comment

Design a site like this with WordPress.com
Get started