Facade pattern एक सरलीकृत इंटरफेस जटिल subsystem प्रदान करते — त्याची जटिलता एका सिंगल, स्वच्छ entry point मागे लपवून. हे घटकांचा एक गुंतागुंत संच वापरण्यास सोपे करते, अंतर्निहित तपशीलांतक प्रवेश काढून न टाकता.
Facade pattern काय करते
FACADE → a SIMPLE interface in front of a COMPLEX subsystem:
→ the subsystem has many components/steps; the facade provides ONE easy interface
→ clients use the simple facade instead of dealing with the complexity directly
→ the facade coordinates the underlying components
→ HIDE complexity behind a clean, easy-to-use interface
उदाहरण
{
() {
codec = ().(file);
decoded = ().(file, codec);
result = ().(decoded, format);
result;
}
}
().(, );
