|
|
 | |  |
| Any idea Jojo , how we are going to satisfy OCP. | |
 | |  |
|
 |
 | |  |
| I think our Switch class should call a common interface like serverInterface and not directly access Light class. | |
 | |  |
|
|
|
|
|
 |
 | |  |
| Switch will access Light or Fan through ServerInterface,not directly. With this design we can use switch to control other devices also. | |
 | |  |
|
|
|
|