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
8
votes
1 answer

What is the difference between a Controller and a Facade?

In my applications, I used to call Facade methods in the main application using they as Controllers because I thought they are the same thing, but now I think I was wrong. My application use multiple Facades, each one for a kind of task. If I change…
7
votes
2 answers

How is slf4j a facade?

I am trying to understand the details of slf4j. I am still not clear on how slf4j is considered as a Logging facade? The intent of facade is to typically - Provide a unified interface to a set of interfaces in a subsystem. Facade defines a…
AgentX
  • 1,252
  • 2
  • 19
  • 34
7
votes
2 answers

Facade pattern vs. SRP

In the classic Facade pattern, a single object usually provides a simplified interface to something more complex. As the Gang-of-Four put it (as close to "official" as it gets...): Facade (185) Provide a unified interface to a set of interfaces in…
6
votes
3 answers

Are there any existing Java caching facades?

I'm getting ready to start working on performance in an application which will eventually be running distributed, but currently is in [greenfield] development. I'd like to be able to introduce caching without either selecting or committing to a…
Matt Mills
  • 8,209
  • 6
  • 32
  • 59
6
votes
2 answers

How to create custom Facade in Laravel 4

Looked up a few tutorials on facades and laravel 4... tried some... not liked the way they work. For instance, they don't all provide a way of defining where to store the facade files and service providers... and i tried to step away from that and…
ied3vil
  • 924
  • 1
  • 6
  • 17
6
votes
1 answer

When to use Facades and when to inject dependencies

I am currently building a web app in php using Laravel-4, however, I suspect that this question is applicable to other languages and frameworks as well. I have read about dependency injection and Facades and understand the necessary coding in each…
Ben Thompson
  • 4,343
  • 7
  • 32
  • 49
6
votes
3 answers

Use of Facade Pattern

How can I know that I need a facade Pattern at a point in my application development? How can I draw the line between Facade Pattern and Template Pattern? For example: In [this] article, we see that, int placeOrder(int CustomerID, List
user366312
  • 17,582
  • 55
  • 198
  • 392
5
votes
3 answers

Python create own dict view of subset of dictionary

As the many questions on the topic here on SO attest, taking a slice of a dictionary is a pretty common task, with a fairly nice solution: {k:v for k,v in dict.viewitems() if some_test(k,v)} But that creates a new dictionary, with its own mappings.…
Marcin
  • 44,601
  • 17
  • 110
  • 191
5
votes
3 answers

How to hide __methods__ in python?

I just wondered, how to hide special __.*__ methods in python*? Especially I am using an interactive python interpreter with tab-completion, and I would like to display only the methods my modules expose ... thanks, / myyn / *(at least from the…
miku
  • 161,705
  • 45
  • 286
  • 300
5
votes
2 answers

Modules + Fascade + Mediator combination in JavaScript

I've finished reading a great article on http://addyosmani.com/largescalejavascript/ This article explains how to combine modules, a facade, and a mediator together for a JavaScript application. I can code what the article explains, but I don't…
Moon
  • 20,835
  • 65
  • 174
  • 263
5
votes
4 answers

Is "Facade design pattern" and Java interface conceptually same?

Is "Facade design pattern" and Java interface conceptually same ? As both achieve abstraction by providing simple way of expressing a complex functionality. Can we say by creating interface we followed Facade pattern ?
Kaushik Lele
  • 5,681
  • 9
  • 44
  • 68
5
votes
1 answer

Facade or Decorator

Context : I have a REST Service let's say CustomerService which for now has one method getCustomer(id, country). Now requirement is that depending upon country I have to perform different business logic like access different database or some custom…
Sikorski
  • 2,375
  • 2
  • 23
  • 44
5
votes
1 answer

Whats the point of using Facade with IoC in Laravel

I don't understand the point of Facade if you are going to inject your class into a controller as part of IoC. Say I have a custom facade called PostHelper. I have the following 2 functions: class PostHelper { public function __construct() {}…
Kousha
  • 22,419
  • 30
  • 119
  • 232
5
votes
1 answer

Laravel: do facades actually create new objects on calling methods?

I have a demo class normally bound via $this->app->bind('demo', function() { return new Demo(); } An set up a facade protected static function getFacadeAccessor() { return 'demo'; } The class itself looks like this class Demo { …
Luuk Van Dongen
  • 2,131
  • 5
  • 20
  • 37
5
votes
3 answers

Auto-generate a strongly-typed AppSettings class

Here's the question first: Is this possible? I'm taking my inspiration from Joe Wrobel's work (a redux of the forgotten Codeplex project). Here, you do your work on creating your profile for the provider, and it does the legwork of creating the…
Dan Atkinson
  • 10,801
  • 12
  • 78
  • 106
1 2
3
23 24