Skip to content

Commit 35bcbf5

Browse files
committed
Bridge design pattern - class and sequence diagrams added
1 parent 1013741 commit 35bcbf5

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

4_4_Bridge_pattern_sequence.png

132 KB
Loading
328 KB
Loading

pattern/src/com/premaseem/BridgeRemoteControl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
public abstract class BridgeRemoteControl {
99

10+
// Introduced has a relationship
1011
private ITV tv;
1112

1213
public BridgeRemoteControl (ITV tv) {
@@ -25,6 +26,7 @@ public void setChannel (int channel) {
2526
tv.switchProgram(channel);
2627
}
2728

29+
// additional features
2830
public void recordProgram(){
2931
System.out.println("IndependentRemoteControl use keyword to set channel.");
3032
}
@@ -44,7 +46,7 @@ public void setChannelKeyboard (int channel) {
4446

4547
}
4648

47-
49+
// coupled implementation of remote controller
4850
class DependentRemoteControl implements ITV {
4951
@Override
5052
public void on () {

0 commit comments

Comments
 (0)