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

Laravel form face use $key => $value ($value2) instead of $key => $value

Sorry if the title is misleading... I have the following to create a select box using the laravel Form facade: {{ Form::select('category_select', $categories_select, null, array('class' => 'selectpicker show-tick', 'data-live-search' => 'true',…
xTheWolf
  • 1,756
  • 4
  • 18
  • 43
0
votes
1 answer

Why does my update() method create a new instance?

I have a problem in the basic CRUD operations on a database in my J2EE Application. Entity: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "shop_id") Facade: public abstract class AbstractFacade
Chris
  • 1
  • 2
0
votes
1 answer

Nodejs Facade pattern for interact with different API web services

I am working with a NodeJs App and I have to call to a online web service in the logic part. The problem is that if that web service is taken down, the whole system stop working. To deal with this I have though in use a Facade pattern, adding…
overflow13
  • 31
  • 4
0
votes
0 answers

Could not open input file: composer

I am trying to pull in a shopping cart facade to my Laravel application. Upon pulling in the Facade vis composer, I get the following error: Could not open input file: composer I don't understand what I'm doing wrong. I've tried several shopI…
Tom Morison
  • 564
  • 1
  • 8
  • 26
0
votes
1 answer

Creating facade idiomatically in Ruby

I'm trying to implement a Facade in idiomatic Ruby while coming from Java. I can see that Rails' ActiveRecord is fond of using class methods for things like find_by(criteria) and does not use Repository pattern for that task. My Facade wraps a…
bezmax
  • 25,562
  • 10
  • 53
  • 84
0
votes
2 answers

Is there a way to embed a class in a new namespace with the same name?

We're attempting to hide a class behind a new namespace, however we'd like to keep the original name. namespace first { class Logger { ... }; } namespace second { using Logger = first::Logger; } error: definition of type 'Logger'…
Ben Crowhurst
  • 8,204
  • 6
  • 48
  • 78
0
votes
1 answer

node.js exporting methods facade design pattern

I am trying to follow the facade design pattern in a node.js application where I have on object that is used with the rest of the application called controller.js as the facade. The controller controls calls to objects user.js, animal.js, and…
cavs
  • 367
  • 1
  • 3
  • 14
0
votes
1 answer

Get total number of sheet in Laravel

I'm trying to get the total number of sheets present in an uploaded Excel file in Laravel. The file I'm uploading has 3 sheets. So I'm expecting to get an output of $counter = 3. Code: $counter=0; Excel::load($fileDetails['file_path'],…
CodeBlood
  • 13
  • 5
0
votes
1 answer

My Own Controller Method in Auth Facade in Laravel 5.1

I want to add my own controller method to Auth Facade in Laravel auth()->user()->ownControllerMethod() How can we do that ?
Cihan Küsmez
  • 1,967
  • 5
  • 22
  • 41
0
votes
1 answer

How to setup a Web API Facade pattern

I've been reading about the Facade Pattern and I'm trying to get an idea on how to implement this. This is how I understand how it can be implemented: ------------------------------------------------------------- | (Facade layer) API…
Vivendi
  • 20,047
  • 25
  • 121
  • 196
0
votes
3 answers

Best practice to maintain site class(es)

I am building a web application which uses an externally built class to handle much of the work and rules for the site. Most pages will require access to this class to get the information it needs to display. In the past I would put such a class…
Brettski
  • 19,351
  • 15
  • 74
  • 97
0
votes
2 answers

I can not call @NamedQueries

I'm new in the JSP/EL/EJB WORLD so take it in count please... heheh My question is a continuation of a PREVIOUS Q? so in the comments/answers of the question above is recommended to use customerFacade.findByUserName(String userName), but the problem…
T04435
  • 12,507
  • 5
  • 54
  • 54
0
votes
2 answers

Use of Adapter/Facade pattern to anticipate incompatible interfaces and complexity?

Adapter pattern is mentioned in Wikipedia to fix incompatibilities between an expected interface and an actual interface. Facade pattern is said to obscure complex implementations and present a simplified API. However, would these patterns be used…
Cardin
  • 5,148
  • 5
  • 36
  • 37
0
votes
0 answers

L attached before class name in enterprise web application in java Netbeans "wrong class path"

I'm working with Enterprise web Application(java) in netbeans IDE first time so thats why i'm facing some problems. i created it and build connection with database. then created page and run. it is working fine but when i import class in servlet…
0
votes
2 answers

How to prepare queries in PHP MVC facade pattern?

How to prevent an app against SQL injection using prepared statements for each SQL query. I have some "manager" classes that handle queries and call static methods from a specific class designed for database connexion and query running. This one…