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
17
votes
2 answers

Laravel File vs Storage facade

Is there any differences between File and Storage facades in laravel 5.2 ? it seems they both use the same contract.i see no documentation for File in laravel documentation. if they are different how may interact with each other?
alex
  • 7,551
  • 13
  • 48
  • 80
16
votes
3 answers

Symfony how to get container in my service

I have symfony project and inside this project, I have big own service which is huge and complicated with own dependencies etc... And I wanna create facade for this service with purpose to use my service in controllers like: $myService =…
cn007b
  • 16,596
  • 7
  • 59
  • 74
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
  • 38,125
  • 75
  • 201
  • 285
14
votes
1 answer

Laravel Difference `between app->bind` and `app->singleton`?

I've been trying to figure out what the difference between app->bind and app->singleton are when setting up a service provider in Laravel. I was under the impression that if I register an singleton it would return the same instance of the object…
Rob
  • 10,851
  • 21
  • 69
  • 109
12
votes
4 answers

PhpStorm Laravel 5.4 automatic facades support

As you may know or not, Laravel 5.4 introduced automatic facades. I'm using PhpStorm and don't know if getting a working autocomplete is possible. Standard facades work because I'm using laravel-ide-helper, but (I guess) automatic facades don't…
user5222939
12
votes
2 answers

Can I use an std::vector as a facade for a pre-allocated (raw) array?

I have acquired a memory location from DirectX where my vertex information is stored. An extremely convenient way to deal with vertex information is to use a std::vector<> of a struct containing vertex info. Given that I have a pointer to a large…
kvanbere
  • 3,289
  • 3
  • 27
  • 52
11
votes
3 answers

Laravel 5.5 PHPunit Test - "A facade root has not been set."

When I do a try/catch on the DB::Connection()->getPdo();, I get the error A facade root has not been set. I believe it was happening with the Schema facades too before I tried adding the try/catch. The tests directory is, of course, outside of the…
Justin Anthony
  • 416
  • 1
  • 3
  • 13
11
votes
1 answer

Does Facade in Laravel implements Facade or Proxy Pattern?

As I understood, the Facade Pattern's intent is to provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use. This can be used to simplify a number of…
Rezigned
  • 4,901
  • 1
  • 20
  • 18
10
votes
3 answers

Passing temporaries as non-const references in C++

I have the following piece of code, as an example dec_proxy attempts to reverse the effects of the increment operator upon the type that is executed in a complex function call foo - which btw I cannot change the interface of. #include…
Xander Tulip
  • 1,438
  • 2
  • 17
  • 32
10
votes
8 answers

Hiding classes in a jar file

Is it really impossible to hide some classes in a jar file? I wanted not to allow direct instantiation of the classes to keep it more flexible. Only the factory (or a facade) should be visible of this jar. Is there any other way than solve this…
nrainer
  • 2,542
  • 2
  • 23
  • 35
10
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…
9
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
  • 6,439
  • 13
  • 50
  • 76
9
votes
2 answers

Does the Facade Pattern violates the SOLID principles?

I ask my self if the Facade Pattern violates the SOLID principles and if the pattern itself is an Anti Pattern. UPDATED My Opinions: SRP is violated, when you don't just call methods directly, but do things like Transactions, Logging, Error…
Rookian
  • 19,841
  • 28
  • 110
  • 180
9
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,402
  • 3
  • 23
  • 38
9
votes
2 answers

Laravel 5.2 What goes in facade getFacadeAccessor return

So I am trying to create my first ever Service provider and complimentary Facade in Laravel. Service Provider:
Bill Garrison
  • 2,226
  • 3
  • 34
  • 75
1
2
3
26 27