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

359 questions
192
votes
21 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
  • 12,589
  • 27
  • 75
  • 102
144
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? I have never read a clear explanation, what's yours?
user310291
  • 33,174
  • 71
  • 241
  • 439
123
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? Thanks
devoured elysium
  • 90,453
  • 117
  • 313
  • 521
85
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
68
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,131
  • 5
  • 20
  • 37
62
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…
59
votes
11 answers
42
votes
3 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
  • 23,007
  • 13
  • 73
  • 124
36
votes
3 answers

What is the differences between facade pattern and abstarct factory pattern?

I'm not asking the interview point of view. I want to know the real time scenario of implemented in the projects like the struts framework etc.
28
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
  • 25,688
  • 19
  • 82
  • 110
21
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
  • 54,536
  • 12
  • 88
  • 131
20
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
  • 42,284
  • 65
  • 185
  • 246
18
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
  • 213
  • 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,629
  • 9
  • 55
  • 88
14
votes
3 answers

Why use Facade pattern for EJB session bean

I want to ask what is the reason to use Facade Pattern when access EJB Session Bean. In my Netbeans 6.9.1, if I do New > Sessions Bean for Entity Classes, and let say that I select User entity, then Netbeans would generate this…
Thang Pham
  • 35,825
  • 73
  • 192
  • 279
1
2 3
23 24