Jump to content

Factory Pattern Delema


Recommended Posts

How do I instantiate every child so that I can call supported modules in each child to then determine which child to instantiate? In addition, how do I only call children that I am their parent?

I have stumbled upon a difficult problem. I am writing a HAL where the parent is the type of instrument (for example, power supply) and the child contains the specific code for a specific instrument. It also seemed to make sense that the child also contained the code specifying which specific instruments it supports. Does it make sense to try to instantiate every child object so that I can call supported instruments and then determine which one to keep? Is there a better way to do this?

Also, since this is a plug-in architecture, I plan to have one folder with each class in it as a packed project library. But it will potentially have power supply parent and children as well as spectrum analyzer parent and children and so on. How do I only open the power supply classes?

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.