Adapter 5

Author: Rohit

Date: December 14, 2011

by Rohit
12-14-11
By Inverting the ownership we have inverted the dependancy and satisfied the DIP. Let's see the new UML.
Hmm....
Here I changed the interface name to SwitchableInterface to clearly show that Ownership lies with Switch. And change in interface will happen only when policy changes.
Yes I got it ! So change will happen when client wants and it will not be forced by implementation classes Like Fan Now.