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
4
votes
6 answers

How to fix Class 'App\Http\Controllers\Notification' not found in laravel?

I have a Controller which listens to a new Schedule creation and sends the result back to the view via ajax. Inside of it I want to add a Notification to send email to the user once the Schedule cannot be completed due to a lack of resources at that…
Jaqueline Passos
  • 1,301
  • 2
  • 24
  • 37
4
votes
0 answers

What is the best approach to use Controller, Facade, Service, Repository in Spring MVC?

I wanna to know the best approach to use Controller, Facade, Service, Repository in Spring MVC. The structure in my current project is: AController -> AService(business logic in here) -> ARepository BController -> BService(business logic in here)…
William
  • 51
  • 3
4
votes
1 answer

How is Laravel able to place facades in a global and custom namespace?

I've had this problem for a while, and it's really been bugging me, so I figured I'd ask. In Laravel, how are they able to allow access to facades with two namespaces? If you don't understand what I mean, here's an example. Both of the following…
Dastur
  • 684
  • 6
  • 23
4
votes
1 answer

Facade pattern for Symfony2 services

New to Symfony2, I'm building an app that uses an external API to get data. I created a lot of client classes to retrieve and transform each entity from the API, and I defined those classes as services - e.g., I have a FooClient with methods like…
MikO
  • 18,243
  • 12
  • 77
  • 109
4
votes
1 answer

Where to put code for creating namedQuery in Facade pattern?

I'm using GWT, Oracle db, Glassfish server, JPA for my application. No problems on client-side. Also using Facade pattern in server-side. AbstractFacade.java public abstract class AbstractFacade { private Class entityClass; public…
Belamors
  • 65
  • 1
  • 6
4
votes
4 answers

Java EE Parameter Constraint Configuration strange behaviour

Im trying to add a parameter constraint configuration (a bean validation) on the create and edit method of the standrd AbstractFacade (as generated by NetBeans). So I tried: @Override public void create(@WkTeilnahmePlanedResult WkTeilnahme entity)…
mpunktw
  • 267
  • 2
  • 4
  • 12
4
votes
1 answer

Design pattern choice for domain/business layer

I am trying to avoid this class ContentDomain becoming a God class and isolating the functionality into specific classes (to follow SRP) like this ContentDomain: public class ContentDomain : IContentDomain { private ISolutionDomain…
Arpit Khandelwal
  • 1,743
  • 3
  • 23
  • 34
4
votes
0 answers

Decreasing coupling and cohesion by facade pattern

For my Software Design class, I have to find out if it is possible to decrease coupling and decrease cohesion at the same time by using the Facade pattern? As you all probably know, when there is low coupling, the cohesion of the classes is high and…
4
votes
1 answer

Laravel 4: Config get returns array or null

I have already published the config files inside app/config/packages/lightshire/laravel/ using php artisan config:publish. I'm trying to access this $client_id = Config::get('lightshire/laravel-paypal::client_id'); and all it returns is array(0) {…
lightshire18
  • 43
  • 1
  • 4
4
votes
2 answers

What are the best practices for Facade pattern?

I have my code working, but I don't know if the way that I implemented it is appropriate. Basically, I want to maintain the pattern without violating it. The code looks like this: Package Model (with setters/getters omitted): public class CA { …
guille8
  • 45
  • 4
4
votes
1 answer

Issue with Facade and Service Provider in Laravel-4

I am trying to set up a Facade for a custom built class in laravel-4. However, when I try to load my website I get an error which reads Class 'PlaneSaleing\ResizerServiceProvider' not found I have followed the tutorial here:…
Ben Thompson
  • 4,743
  • 7
  • 35
  • 52
4
votes
1 answer

Is a Facade Pattern with only static functions an unnecessary layer

I am currently using IKVM to gain access to a large Java library within a C# .Net project. The libraries entry point is a singleton and from there I am able to create objects and set an objects properties. I have currently created a C# Facade…
flip
  • 391
  • 1
  • 7
  • 15
4
votes
1 answer

Laravel 4: use Facade in custom Class

I'm developing an app using Laravel 4 and I have a question I'd like to be asked before fully commit to it. I've created some custom classes and facades that has been added with success to laravel's configuration file. For example: namespace…
Ingro
  • 2,841
  • 5
  • 26
  • 42
4
votes
0 answers

Mapping/translating/converting between different APIs

Are there open-source or other commercial alternatives to Oracle's OSDI? In my scenario, I have a legacy API (it's what the customer systems use and can't be changed). I have an underlying product that has the functionality needed to replace the…
The Archetypal Paul
  • 41,321
  • 20
  • 104
  • 134
4
votes
1 answer

facade pattern pros and cons

hi im reading the book " applied java patterns" about facade pattern and im trying to find out what is good and bad about it, it says... "The benefit of the Facade pattern is that it provides a simple interface to a complex system without reducing…
Ron Paul
  • 183
  • 3
  • 11