Skip to main content

Questions tagged [facade]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
178 views

How to refactor code so that a facade class could be decoratable?

I've got a class that is a facade class (encapsulates complex-ish behaviour for reusability). It has a function called manage (the class is called Manager): function manage() { $entityBuilder = '...
pro100tom's user avatar
  • 449
-1 votes
3 answers
762 views

What is the difference between Facade and God?

A Facade is a higher level API over a whole subsystem. A God is class that violates SRP. Where do we draw the line? Does the following code represent any of the two: enum UnitType{Demon, Paladin}; ...
Vorac's user avatar
  • 7,129
1 vote
1 answer
157 views

Does it make sense to have a facade centralizing events too?

From my understanding a facade is a class with the sole purpose of simplifying the use of a specific system/module behavior (its methods). It should not contain any relevant logic of the underlying ...
andresantacruz's user avatar
1 vote
1 answer
90 views

Choosing which operations to perform in the front-end or the back-end

I am implementing a system where in the front-end, the user needs to select if option A or option B should be active. Depending on the option, a conversion module converts other input data for use ...
Toivo Säwén's user avatar
0 votes
2 answers
1k views

Separate DTOs consequently for each module?

Following the hexagonal architecture and package design you will have somewhere an entry point reaching to your core functionality. Often this is done by using a facade. To hide the core logic from ...
Jim Panse's user avatar
  • 398
1 vote
3 answers
717 views

Is it good practice to create a facade only to be able to mock the wrapped implementation?

I'm currently writing unit tests for ASP.NET Core Controllers. Some controllers inject UserManager<T> which seems to be a really hard type to mock. After some attempts to mock or even fake it, I ...
Sandro's user avatar
  • 113
-1 votes
1 answer
641 views

What is the C++ equivalent of a logging facade in Java?

I'm currently writing a library in C++ and was wondering if I should log from within it. Googling the issue I came across this question but it makes reference to a logging facade. Is there anything ...
ruipacheco's user avatar
1 vote
1 answer
1k views

Decorator or Facade

I face an issue if to use a decorator or facade pattern to accomplish my needs. Imagine a client wants to play a video. He can use the interface public interface IVideoPlayer { // Prepares ...
Creepin's user avatar
  • 219
3 votes
1 answer
2k views

Multiple Facade Classes must be combined in 1 Facade Class

Is this some rule that if I have multiple Facade classes they must be combined in 1 Facade Class? For example, I have a Hospital System with different classes, like Appointment, Patient, Doctor, ...
sallushan's user avatar
  • 179
1 vote
2 answers
1k views

Is it okay to put all your error handling on facade layer?

I am doing a Java Spring-Boot backend project and I am implementing a controller-facade-service pattern on my structure. So is it best to put all my error handling on the facade layer, while the ...
alona's user avatar
  • 21
0 votes
1 answer
603 views

Should Facade handle all exceptions or throw

I am trying to abstract the elasticsearch python client. I have a method index document def index(self, body, id=None): """ Inserts one document into elasticsaerch. If id is ...
user avatar
0 votes
2 answers
98 views

Using typeless maps on api boundaries

What do you think about passing typeless maps to APIs (packages, systems, adapters) outer to Core Domain as in 1st Way below? Strongly-typed objects are inside Domain API, and business rules are ...
Inanc Gumus's user avatar
2 votes
5 answers
1k views

Facade pattern or just expose child objects?

Wondering about pros and cons around a facade pattern implementation (or perhaps there is a better pattern I should consider), versus simply exposing a dependent object to a caller. Consider the ...
gdbj's user avatar
  • 123
-6 votes
1 answer
1k views

C# Console application - Is the main method Facade [closed]

Currently I am making a console application. Is that right that the Main method of a .net console application is a facade? Is any console application entry method is a facade?
Icebraker's user avatar
-3 votes
1 answer
130 views

How can interface work, if there is no code inside its abstract methods?

Interface is used to implement more than one class but it doesn't have any code inside its methods... however the method that is called works with its respective function. Also, it gets very confusing ...
Saugat Thapa's user avatar
2 votes
1 answer
2k views

What if Facade contains business logic?

Consider that the Facade has inside it lots of sub-components but it done not pass messages from one sub-component to the other but also has some business logic in it. Is it still Facade pattern?
Narek's user avatar
  • 1,143