beefeater267
Programmer
- Apr 6, 2005
- 79
Hello,
I have some questions regarding how to design this in a proper OO manner. So, I'm designing a win app to perform various tests.... so, i have a baseclass "LoadTest"... and have subclasses : "TestA", "TestB", etc....
So, each test performs the same tasks with variation in the middle as such:
EXAMPLE of procedure:
for (int i=0 ; i<=SOMETHING; i++)
{
some common operations here for all Test objects
operations dependant on subclass type (TestA, TestB, etc)
some common operations here for all Test objects
}
So, how do I structure my methods? I'm confused. I want to put my operations into a method called "RunTest".
Can anyone help me out on how to structure this? I started out by creating :
public virtual void Run() in the LoadTest class and also:
public override void Run() in the TestA class
So, I have a reference to a TestA object... I know I can put all the code of the procedure in EACH subclass , but, i know this is repitiious and there has to be an OO way.
ANY HELP? THANKS 4 SAVING ME!
I have some questions regarding how to design this in a proper OO manner. So, I'm designing a win app to perform various tests.... so, i have a baseclass "LoadTest"... and have subclasses : "TestA", "TestB", etc....
So, each test performs the same tasks with variation in the middle as such:
EXAMPLE of procedure:
for (int i=0 ; i<=SOMETHING; i++)
{
some common operations here for all Test objects
operations dependant on subclass type (TestA, TestB, etc)
some common operations here for all Test objects
}
So, how do I structure my methods? I'm confused. I want to put my operations into a method called "RunTest".
Can anyone help me out on how to structure this? I started out by creating :
public virtual void Run() in the LoadTest class and also:
public override void Run() in the TestA class
So, I have a reference to a TestA object... I know I can put all the code of the procedure in EACH subclass , but, i know this is repitiious and there has to be an OO way.
ANY HELP? THANKS 4 SAVING ME!