Structural Design Pattern Confusion

on

The other day my team was having a discussion about some software we were working on.  During the discussion, several of the structural design patterns were mentioned, sometimes interchangeably. This is a brief overview of  three of them for future reference.

The Facade

The Facade defines a single, simplified interface over one or more subsystems.  Common usage of this is simplifying a remote system’s interface.

The Adapter

The Adapter changes (aka adapts) the interface of a class to match what is expected by a caller.  I have used this in the past to provide a common interface for getting/setting the value of web controls.

The Proxy

The Proxy stands in for another class, intercepting the call and then usually passing the call on to the class the proxy is representing.  Common usage of this is a proxy defined for WCF service or an NHibernate proxy for lazy loading.  The end result is additional behavior, like remoting complexities or lazy tracking, are injected into the the call stack without the user of the proxy having to know about it.

No comments:

Post a Comment