Let's say you have two classes that extend UserControl
. Each of the controls provides a custom event
(this could be done by using an interface).
You want to display one of the controls in the odd days and the other in the even days.
You also want to be able to drag&drop (Visual Studio) the UserControl
on your form without knowing what the Control type will finally be.
How do you do that ? Is the factory pattern useful here ?