1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Rep Power

    Question 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)
    <Device property="override">
    	<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>
    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.

    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,
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Aug 2008
    Rep Power
    Hi eyoung,

    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.
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

    Jquery Shake Effect ,
    Andriod KitKat

    Thank You,

Similar Threads

  1. Replies: 2
    Last Post: February 24th, 2012, 07:50 PM
  2. Refactoring sql into regexp - Microsoft Access
    By johnmerlino in forum Visual Basic Programming
    Replies: 1
    Last Post: October 20th, 2010, 02:55 PM
  3. Inheritance in C#
    By DevAdmin in forum Development Articles
    Replies: 0
    Last Post: May 10th, 2007, 08:00 AM
  4. Inheritance with VB.NET 2005
    By DevAdmin in forum Development Articles
    Replies: 0
    Last Post: July 18th, 2006, 08:00 AM
  5. PHP 5 Inheritance
    By elijathegold in forum Programming Help
    Replies: 3
    Last Post: May 12th, 2006, 05:18 AM

IMN logo majestic logo threadwatch logo seochat tools logo