What is the difference between Facade and Gateway design patterns?

Reviewing Facade in the GoF book and the link in another answer to Martin Fowler’s Gateway, it appears that their focus is in opposite directions.

Facade provides a simple uniform view of complex internals to (one or more) external clients;

Gateway provides a simple uniform view of external resources to the internals of an application.

This distinction lets us focus on which is more important in a design:

With the Facade, the external system is our customer; it is better to add complexity facing inwards if it makes the external interface simpler.

With the Gateway, the internal system is our customer; give it all the help we can, even if the externals are more complex.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)