91-9990449935 0120-4256464 |
Bridge PatternA Bridge Pattern says that just "decouple the functional abstraction from the implementation so that the two can vary independently". The Bridge Pattern is also known as Handle or Body. Advantage of Bridge Pattern
Usage of Bridge Pattern
Example of Bridge PatternThe UML given below describes the example of bridge pattern. UML for Bridge Pattern:Implementation of above UML:Step 1Create a Question interface that provides the navigation from one question to another or vice-versa. Step 2Create a JavaQuestions implementation class that will implement Question interface. Step 3Create a QuestionManager class that will use Question interface which will act as a bridge.. Step 4Create a QuestionFormat class that will extend the QuestionManager class Step 5Create a BridgePatternDemo class. Output
Next TopicComposite Pattern
|