architectural-patterns

What is the difference between an Abstraction and a Facade?


What is the difference between an 'Abstraction' and a 'Facade'?

Is there a difference at all? Or are the terms interchangeable?


Solution

  • The facade pattern is an simplified interface to a larger, possibly more complex code base. The code base may be a single class, or more. The facade just gives you a simple interface to it.

    Abstraction, is used to represent a concept, but not to be bound to any specific instance. (Ie: An abstract class). This doesn't imply simplifying (like the facade pattern does), but rather making a 'common' interface or representation.