Showing posts with label design patterns. Show all posts
Showing posts with label design patterns. Show all posts

Wednesday, October 25, 2017

Enterprise Application Architecture Design Patterns - Facade vs Gateway vs Proxy

Facade

an object that provides a simplified interface to a larger body of code

Gateway

An object that encapsulates access to an external system or resource.

Proxy

a wrapper or agent object that is being called by the client to access the real serving object behind the scenes

The three patterns are similar in a way that it used to simplify the access to more complicated services, systems or resources etc.

The differences are:

Proxy is usually expose same interface as the real object it represents, it usually locates at the client side and communicates with the real object remotely.

Gateway handles more complicated situations where external systems, resources etc. could be represented as a simplified form. The goal is to encapsulate the implementation details and complexities of external services, libraries, systems, resources etc.

Facade is the opposite of the Gateway pattern, it provides a simplified interface to the objects you own.