I have a custom class object (clsAsset) and a custom collection object(clsAssets). I am pulling the various property values from the objects (over 300 objects), and calculating statistics in a public array (i.e. DataArr() as Variant). The array is 2D and each row represents the values from the underlying objects and the resulting analytic results run on those property values. All the data and statistics reside in DataArr(), and as they are calculated in a simulation, their is a lot of data created. I delete all the data in DataArr() after each loop and transfer stats on its results to a Publicly declared Dictionary object called FinalResults.Dict().I then provide sum and average calcs on the FinalArr().
So as you can see here, I mixing the benefits of custom objects and custom collections while still using Public arrays and Public Dictionaries. I am starting to wonder if I need to do that or if I can lever off the benefits of the custom collection I have already created.
I am assuming that another way to do this would be to simply create a property (Asset.Data) for the objects that takes an array (as a variant). I would then have this for all the objects. This array property for the individual objects would replace the individual rows in DataArr(). So instead of populating DataArr() with the results of each object and running analytics on it, I assume I could run those same procedures in a method of the custom collection object that I have already created (i.e. Assets.RunAnalytics) and this would run a function that loops through the individual objects, pull the individual object property values and calculate the stats. An example I can think of is a sort function. Instead of sorting the public array (I.e. DataArr = BubbleSort(DataArr)) and storing the sort order for each asset in the array, I could use a collection sort method which pulls all the individual object properties into a temporary array in the collection method and calculates the sort order.
So my question is, does this make sense and are their benefits to doing this? Would this provide runtime benefits relative to storing data in a public array/dictionary?
Thanks
So as you can see here, I mixing the benefits of custom objects and custom collections while still using Public arrays and Public Dictionaries. I am starting to wonder if I need to do that or if I can lever off the benefits of the custom collection I have already created.
I am assuming that another way to do this would be to simply create a property (Asset.Data) for the objects that takes an array (as a variant). I would then have this for all the objects. This array property for the individual objects would replace the individual rows in DataArr(). So instead of populating DataArr() with the results of each object and running analytics on it, I assume I could run those same procedures in a method of the custom collection object that I have already created (i.e. Assets.RunAnalytics) and this would run a function that loops through the individual objects, pull the individual object property values and calculate the stats. An example I can think of is a sort function. Instead of sorting the public array (I.e. DataArr = BubbleSort(DataArr)) and storing the sort order for each asset in the array, I could use a collection sort method which pulls all the individual object properties into a temporary array in the collection method and calculates the sort order.
So my question is, does this make sense and are their benefits to doing this? Would this provide runtime benefits relative to storing data in a public array/dictionary?
Thanks