質問

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 the options provided by the total system. This interface protects the client from an overabundance of options.

The Facade translates the client requests to the subsystems that can fulfill those requests. Most of the time, one request will be delegated to more than one subsystem. Because the client interacts only with the Facade, the internal working of the system can change, while the client to the Facade can remain unchanged.

The Facade promotes low coupling between client and subsystems. It can also be used to reduce coupling between subsystems. Every subsystem can have its own Facade and other parts of the system use the Facade to communicate with the subsystem."

is low coupling between client and subsystems bad ??? thanks

役に立ちましたか?

解決

Coupling is not bad.

Useless coupling is bad, because:

  • It leads to a larger API to maintain
  • It hides the important information in useless information

A facade allows you to have exactly the required coupling between two entities

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top