November 2nd, 2012, 10:07 AM
Inheritance Issue Caused by Refactoring - Is There a Fix??
I posted this over at the Asp.net Forums about 13 hours ago, but I'm looking for lots of approaches to solve issue, so I could use some input from lots of different sources.
I am currently working for a company that developed a real-time data display program in vb6. It was successfully converted to .net and now I inherited it in hopes of someday migrating it to the web. Before I can do so, it needs a lot of work, as some classes are 7,000+ lines by line count. I have successfully broken it up into the following hierarchy: (XML Representation)
There can be up to 254 <ControlClasses> all inheriting from their parent <Device(name)>while the individual <Device(name)> for each overrides the "Master Class" Device. I know there is probably a better way to do this, but this is what I inherited. There were no <ControlClasses> when I started and each device class was causing compiler issues as I was told to add more logic, such as "Unable to obtain value" from DateTime.Now.
<DeviceA inherits="Device" variables="public">
<Control Class inherits="DeviceA" variables="private shadows">variables and logic for DeviceA</ControlClass>
<DeviceB inherits="Device" variables="public">
<Control Class inherits="DeviceB" variables="private shadows">variables and logic for DeviceB</ControlClass>
<DeviceC inherits="Device" variables="public">
<Control Class inherits="DeviceC" variables="private shadows">variables and logic for DeviceC</ControlClass>
<Description>This form Displays Realtime Data returned from <Device></Description>
My issue is this: All the functions that control the Realtime Data Display were written as Device.Get(). Is there a Way to pass variables From <ControlClass> to <Device(name)>thru to Device, so that I can keep the current Call structure in the Display Form? (I see the proper value in <Device(name)>, but get the error <Device(name)> is not a member of <Device>, when I try Device(name).Device.Get(), and also Device.Device(name).Get()) does not contain the get() methods.)
Currently, the form loads, along with the array of Devices, and the Device will update, but the update does not refresh on the Display Form, so no data displays and no form interaction takes place because all the Getter's() are null, as they are expecting values from <Device(name)>, where the <ContolClass> used to exist.
Any Input Appreciated,
November 16th, 2012, 01:54 PM
first of all, i appreciated you way of questioning and the way you represent your issues.
now i come to your issues "Device(name).Device.Get()," i thing this way you can easy get the value. have you debug the code any error message you got on same. Getter's() where is the declaration of same.