Reusing Objects

RobEmDee

Centurion
Joined
Mar 25, 2003
Messages
130
Location
Richmond, VA
(This isn't an ADO.NET ?, bear with me for a few lines.) I have a relatively complex filtering scenario for a DataView in the app that I am developing which is extremely dynamic. I currently use Class Level Fields (string and integer) in which I capture the different pieces of the Filtering statement across multiple EventHandlers and then compile the DataView.Rowfilter. The ?: In situations like this, when 'placeholders' are needed, is it any less or more efficient or resource friendly to Dim in a new Variable each time the data is captured or is using a Class Level Field and just replacing the value each time ok?
 
Thanks for responding Robby.....is your decision based upon resources sensitivity or keeping the Class functionality simpler? I need to build a Filter based upon selections in three different input Controls, each of which triggers a refiltering after a selection is made. If I declare in Local Variables each time, I will have to pass around a lot of data. My thinking in using Class Level Fields was that I could just set the value and access the Value from any Function/Sub in the Class. This is still a question about the efficiency of reusing variables in general because I will be resetting these values virtually any time the User interacts with the Form. So could you please expand a bit? Thanks.
 
Back
Top