Question

I'm not asking the interview point of view. I want to know the real time scenario of implemented in the projects like the struts framework etc.

Was it helpful?

Solution

The facade pattern is used when you want to hide an implementation or it is about changing interface of some class or set of classes. Builder hides the process of construction by decomposing it in smaller steps.

Abstract factory pattern is used when you want to hide the details on constructing instances.
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

OTHER TIPS

I don't know, why this was voted negatively. This is a legitimate question.

My take - A facade is a class or a group of classes hiding internal implementation/services from the user.

An abstract factory encapsulates a group of factories which are used for creating objects, whereas Facade can be used to provide abstraction to all kinds of operations, not just creation.

They are two patterns used for thing thats that are completely unrelated.

With the Abstract Factory Pattern you just provide a common factory builder for many different builders for the same thing. This can be used whenever you need to provide an interface to a set of builders meant to be used with something in common (the product) without bothering on what are you going to build or which factory are you going to use.

The Facade pattern instead is used to provide a simple interface to a lot of different operations that the client classes should not see.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top