3

I am overall confused over the use of the facade design pattern. Is facade similar to MVC. I am asking this because I used facade in a project that helped to separate the front end interface from the back end internals.

3 Answers 3

5

I would say that probably you are overlooking many things, MVC is a whole framework that helps you separate concerns like controllers (which handle infrastructure of web requests) and the models (which is the info that you pass to the Views) and the View (which is only interested in presenting information).

The way I think about facades, could apply to everything in which you want to provide a simpler interface of a system component whenever this needs to talk to another system component, this is to avoid complicated APIs that are too cumbersome or too complex.

In relation to facades, there is the adapter pattern, which works exaclty as the facade, trying to simplify the API from a system component, but the difference is that one of the components is not under your control, is something that you cannot modify its behavior. ASP.Net cache might be an example, you will create an ADAPTER to satisfy your requirements, and you will need to update your adapter if the ASP.Net CAche is altered dramatically.

So overall, both are patterns, but I think of MVC as somthing like Framework+Pattern, whereas FAcade is just a simple function to ease your job whenever you work with complex software components.

Hope it helps,

2

In Simplest Words - Facade is used to hide the internal details of System/Sub-System/Layers from the client, while MVC is an architecture to decouple business, presentation and controller.

1

Facade Pattern Provide a unified interface to a set of interfaces in a subsystem.

Facade defines a higher-level interface that makes the subsystem easier to use. This can be used to simplify a number of complicated object interactions into a single interface.

Facade Pattern can be used in MVC Application to enhance the Layered Architecture of Complex MVC Application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.