I have two classes LightA and LightB. I have the source code of LightB but not that of LightA. I extended LightB with LightDimDip. ie LightDimDip:extends LightB
. Now I need to apply DimDip feature to lightB also.
Can any one suggest good OOP design.
Once again I remind you people that I cannot modify LightA.
Do the lights have a common interface? In which case I guess you could use the decorator pattern here
Then you can put the light behaviour in the DimLight class and apply it to any class which implements ILight.