09-29-2014 01:43 PM
Hello,
I need to test some code for functionality (a PMBus over I2C functionality on a Sub-20 board). Eventually this will be an instrumentation subclass in the higher program, but I haven't done much of the overall program yet. Is it possible to create my Sub-20 driver class first, and later tie it into the program's instrumentation class?
Thanks,
Simon
Solved! Go to Solution.
09-29-2014 01:50 PM
Theoretically, yes, but if the parent class has any data elements, you obviously won't be able to use them during your development. Also, any VIs that you would create in the parent class that are dynamic dispatch would have to be already implemented in the child class.
In other words, you kind of have to already know what the parent class needs to be like. Why not go ahead and create it? At least a stub, with all of the data and VIs that your child classes will use?
09-29-2014 02:07 PM
Well, I suppose that I could, but I'm pretty new at this and trying to write a program with a HAL, so there are probably two or three "parent" classes that need to go above the code I want to write now. Since I don't have those very well defined right now, if I create them I will have to refactor that code anyway.
Thanks for the answer though!
Simon
09-29-2014 03:35 PM
This is where UML comes in handy. Define what your class hierarchy will will look like. Define what functions you will need to override. Define what functions will be common to everything and put those in the parent. A good UML diagram is pretty much essencial to a good HAL. You cannot go into it blindly. You need very detailed plan of attack before you even start to code.