Skip to content Skip to sidebar Skip to footer

Why Does The Facade Pattern + Revealing Modular Pattern "add Security"?

REFERENCE According to reference: Below is a more advanced version of the facade pattern that adds security to internal methods. Question: Honestly what do they mean add security?

Solution 1:

This just makes no sense. Really none.

  • There is no added "security". Security is a completely different field when developing web applications.
  • "Works well in combination with other patterns", "Easy to implement" is not really an advantage. The normal design is even simpler.
  • "Makes it easy to patch internals". Sure. But YAGNI. You still can introduce it when you really patch internals, or shim externals.
  • "Provides a simpler public interface". Well, it can be used to reduce the complexity of the interface, especially if the internal methods have additional parameters that are not documented and are expected not to be exposed. But the someMethod in the example does not have any parameters, so it's just useless here.

Actually, the revealing module pattern already is a facade by itself. It defines some internal functions, and then exports them on the module object, whose property names are the external interface. There's no need for an additional layer of indirection.

Post a Comment for "Why Does The Facade Pattern + Revealing Modular Pattern "add Security"?"