Questions tagged [facade]

The Facade pattern is one of the Gang of Four's structural design patterns.

The facade pattern is a software engineering design pattern commonly used with Object-oriented programming. The name is by analogy to an architectural facade.

It is one of the Gang of Four's structural , first published in Gamma et al.'s book "Design Patterns: Elements of Reusable Object-Oriented Software".

From Wikipedia: The Facade pattern provides a unified interface to a set of interfaces in a subsystem. It defines a higher-level interface that makes the subsystem easier to use.


References

392 questions
199
votes
20 answers

What is the facade design pattern?

Is facade a class which contains a lot of other classes? What makes it a design pattern? To me, it is like a normal class. Can you explain to me this Facade pattern?
kevin
  • 13,559
  • 30
  • 79
  • 104
176
votes
2 answers

Difference between the Facade, Proxy, Adapter and Decorator design patterns?

What is the difference between the Facade, Proxy, Adapter, and Decorator design patterns? From a generic point of view, such patterns seem to do the same thing, that is: wrap an API and provide access to it. How to distinguish these patterns? How to…
user310291
  • 36,946
  • 82
  • 271
  • 487
161
votes
16 answers

What is the difference between the Facade and Adapter Pattern?

I've been reading both definitions and they seem quite the same. Could anyone point out what are their differences?
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
91
votes
8 answers

Façade vs. Mediator

I've been researching the difference between these two patterns. I understand that facade encapsulates access to a sub system and mediator encapsulates the interactions between components. I understand that sub system components are not aware of…
Tired
81
votes
11 answers

Are the roles of a service and a façade similar?

The more I read, the more confused I am. Note that all the question is related to how service and facades fit on the MVC pattern. My understanding is that a Facade is not a super-smart object, it is simply a way of exposing a simple interface/api…
76
votes
3 answers

Laravel: Difference App::bind and App::singleton

I get a bit confused over all the nice things laravel has to offer in terms of the IOC container and facades. Since I'm not an experienced programmer it gets overwhelming to learn. I was wondering, what is the difference between these two…
Luuk Van Dongen
  • 2,391
  • 6
  • 26
  • 40
68
votes
12 answers
45
votes
2 answers

What are the differences between facade pattern and abstract factory pattern?

I'm not asking the interview point of view. What is the real time scenario of implementing it in the projects, like the Struts framework, etc.?
42
votes
4 answers

Laravel Custom Model Methods

Whenever I add additional logic to Eloquent models, I end up having to make it a static method (i.e. less than ideal) in order to call it from the model's facade. I've tried searching a lot on how to do this the proper way and pretty much all…
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
29
votes
4 answers

How do I create a facade class with Laravel?

I'm having a little problem with creating a facade model class with Laravel. I have followed http://laravel.com/docs/facades but I guess I'm missing something. I have created a folder in app/models called foo. In that folder I have two files. First…
Marwelln
  • 28,492
  • 21
  • 93
  • 117
26
votes
5 answers

What's a good name for a façade class?

A little background: We're building a library/framework for working with scientific models. We have an interface Model which defines the operations that a model must implement, which is pretty minimal. That is: the Model interface defines the…
Daniel Pryden
  • 59,486
  • 16
  • 97
  • 135
21
votes
3 answers

What is Facades used in Laravel?

I'm confused by the Facades offered by Laravel. The Laravel documentation states: Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to…
Aman Kumar
  • 4,533
  • 3
  • 18
  • 40
21
votes
6 answers

Explain Facade pattern with c++ example?

I have checked with the wikipedia article, and it seems like it is missing the c++ version of a code example. I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?
yesraaj
  • 46,370
  • 69
  • 194
  • 251
19
votes
5 answers

Design pattern that Wrapper Classes use in Java?

I have found an old post which does not clarify my understanding about the design patterns that are used by Wrapper Classes, Moreover, on reading from Wikipedia I'm not getting any clear information. Does a Wrapper Class really use any design…
zack
  • 223
  • 1
  • 2
  • 8
17
votes
3 answers

What is the point of a Facade in Java EE?

I'm not really understanding the point of a facade. public abstract class AbstractFacade { private Class entityClass; public AbstractFacade(Class entityClass) { this.entityClass = entityClass; } protected abstract…
Drew H
  • 4,699
  • 9
  • 57
  • 90
1
2 3
26 27