B
Brett
I have several classes that create arrays of data and have certain
properties. Call them A thru D classes, which means there are four. I can
call certain methods in each class and get back an array of data. All four
classes are the same except for the number of elements in their arrays and
the data.
I have a MainClass (the form), which processes all of these arrays. The
MainClass makes use of third party objects to do this. There are three
methods in the MainClass. Currently, I pass a parameter to these three
methods such as "A as string". This means to process class A. I have case
statements that take this parameter in the MainClass methods to know know
which class needs processing. There is much redundant code here since the
same processing is done for each class. It would be nice if I could just
pass in the class name as a parameter and run the code. Problem is I have
four classes instead of one and can't just pass them in as type class.
Should I place these four classes in a module? How else can I get around
using the case statements in the MainClass?
Thanks,
Brett
properties. Call them A thru D classes, which means there are four. I can
call certain methods in each class and get back an array of data. All four
classes are the same except for the number of elements in their arrays and
the data.
I have a MainClass (the form), which processes all of these arrays. The
MainClass makes use of third party objects to do this. There are three
methods in the MainClass. Currently, I pass a parameter to these three
methods such as "A as string". This means to process class A. I have case
statements that take this parameter in the MainClass methods to know know
which class needs processing. There is much redundant code here since the
same processing is done for each class. It would be nice if I could just
pass in the class name as a parameter and run the code. Problem is I have
four classes instead of one and can't just pass them in as type class.
Should I place these four classes in a module? How else can I get around
using the case statements in the MainClass?
Thanks,
Brett