Skip to content
Open
Prev Previous commit
Next Next commit
Bridge design pattern - class and sequence diagrams added
  • Loading branch information
premaseem committed Feb 25, 2018
commit 35bcbf5a698cb553b79ac1c11a838e532d09fc2f
Binary file added 4_4_Bridge_pattern_sequence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bridge Design Pattern class diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion pattern/src/com/premaseem/BridgeRemoteControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
public abstract class BridgeRemoteControl {

// Introduced has a relationship
private ITV tv;

public BridgeRemoteControl (ITV tv) {
Expand All @@ -25,6 +26,7 @@ public void setChannel (int channel) {
tv.switchProgram(channel);
}

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

}


// coupled implementation of remote controller
class DependentRemoteControl implements ITV {
@Override
public void on () {
Expand Down