-1

Is the facade design pattern considered a "superpattern"? A facade pattern "provides a simplified interface into a larger body of code."

https://en.m.wikipedia.org/wiki/Facade_pattern

The repository pattern is essentially a facade for data access:

https://msdn.microsoft.com/en-us/library/ff649690.aspx

The gateway pattern is a facade for API's:

https://martinfowler.com/eaaCatalog/gateway.html

Are there any other common facade design subpatterns you can think of? Can you think of any other design superpatterns and their subpatterns?

Bernard Vander Beken
  • 4,848
  • 5
  • 54
  • 76
user9173787
  • 139
  • 1
  • 1
  • 4
  • I can't say I have ever seen them as "super patterns" I feel they are all different enough to justify distinction but similar enough to categorize as done by GoF (https://en.wikipedia.org/wiki/Design_Patterns#Patterns_by_Type) or (https://stackoverflow.com/a/3489187/897075). – Alex.Barylski Jan 04 '18 at 16:41

1 Answers1

4

What you see as a "superpattern", is that they all use a wrapper. The difference between these patterns is their intent.

Facade is used to provide a simple interface to clients, hiding the complexities of the operations it provides behind it.

Repository pattern has other objectives. For example, one of the gains we get from repository pattern, is that we enhance our testing capacities by isolating the data layer. Maybe we could achieve the same with facade, but its not its intent.

Also check this question where difference between they intent of facade vs gateway is explored.

martidis
  • 2,897
  • 1
  • 11
  • 13