I am from N00b to OO. and people throw me flames for not responding or not having any points. what can I say, except, I'm not qualified !!!
In any case, here is my question. I have seen more than enough examples of inheritance in your classic "Book" samples. The animal where the Bear growls, Cat meat, etc.
Suppose I create Windows Controls dynamically based on some form of data (database, XML)
Let's say I create a static factory called CreateControl, and I pass control type c for combobox, t for text field, etc. so I have the following syntax Management c = CreateControl ('c'); it returns me a combobox
while the factory template is working. anytime when I want to introduce another control, I go to the switch statement of the factory template and add another type of control.
In my winforms, for each control that I create using this robust factory template, I want to create event handlers based on what control I return, for example, if I create a ComboBox, I create event handlers for 5 different events If in the control there is a text box, there are 2 events. therefore, depending on which control is created, there are different event handlers with different signatures.
some events require values that come from the form where the controls are located, and some do not
I have this switch statement to declare events based on the controls that I create! how to take part of the code in the code and do the right thing that separates the problems and the small or zero code in the code behind!
thanks for the help