Select Page

Facade

Facade

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.

Source Code

/**  * Knows which subsystem classes are responsible for a request.  * Delegates client requests to appropiate susystem objects.  * @role __Facade  */ public class Facade {         /** reference to particular subsystem */         private SubsystemA theSubsystemA;        /** reference to particular subsystem */         private SubsystemB theSubsystemB;        /** this method is called by client */         public void facadeMethod() {                 // multiple subsystems could be involved                 // to provide some functionality         } }  /**  * Implements subsystem functionality. Handles work assigned by the Facade object.  * Has no knowledge of the facade.  * @role __System  */ public class SubsystemA {         /** some functionality */         public void subsystemFunctionality() {         } }  /**  * Implements subsystem functionality. Handles work assigned by the Facade object.  * Has no knowledge of the facade.  * @role __System  */ public class SubsystemB {         /** some functionality */         public void subsystemFunctionality() {         } }
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Categories

0
Would love your thoughts, please comment.x
()
x