I am brainstorming some ideas around a template for use in the following scenario.
I have third-party controls for which I want to add general functionality. Functionality is added by processing several events and performing certain actions when events are triggered along with the addition of some private variables to store state information between events. I want to reuse code and functionality, so I usually do this.
Create a class for this function and pass in the control instance that I want to add to the constructor.
Then I can add event handlers to the control in an instance of the class.
Can anyone think of alternative patterns to use this method for reuse?
source
share