Hi
I want to write a simulation software for some category of physics modes. Because the models are in some ways similar, I want to have a single class that takes care of issuing instructions. And then I want to have several different models that are different, but share a set of methods that can be used by the logic part. Thus something like this
LOGIC class: This class can issue instructions to any class which belong to the category 'MODEL'
category 'MODEL' includes
'XY-MODEL' class and 'GL-MODEL' class.
Now, all classes that belong to the MODEL category have a set of standard methods like
'UPDATE', 'COMPUTE_ENERGY' etc.
Thus, LOGIC does not even know what the underlying MODEL is, it just issues instructions. The type of model is determined in the beginning of the simulation by some argument. This would make my life a lot easier. So can this be done with inheritance?
Best
// Carlis
I want to write a simulation software for some category of physics modes. Because the models are in some ways similar, I want to have a single class that takes care of issuing instructions. And then I want to have several different models that are different, but share a set of methods that can be used by the logic part. Thus something like this
LOGIC class: This class can issue instructions to any class which belong to the category 'MODEL'
category 'MODEL' includes
'XY-MODEL' class and 'GL-MODEL' class.
Now, all classes that belong to the MODEL category have a set of standard methods like
'UPDATE', 'COMPUTE_ENERGY' etc.
Thus, LOGIC does not even know what the underlying MODEL is, it just issues instructions. The type of model is determined in the beginning of the simulation by some argument. This would make my life a lot easier. So can this be done with inheritance?
Best
// Carlis