SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    JQ
    JQ is offline
    Junior Member
    Join Date
    Jan 2000
    Location
    Maynard,MA,USA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    VB Object Hierarchy

    I need to determine a consistent hierarchy within my silk framework. My app has deeply nested controls. I have spent many hours editing the .inc files to create fully qualified tags in order to flatten the crazy application control hierarchy. It seems to be the only reliable way.

    My goal is a data driven architecture, but it requires (I think) a consistent hierarchy of controls. For instance, suppose I want to populate a dialog using a record set from a db and loop through the controls:

    for each ...
    dialog.@(wControl).SetText(sValue)

    Now, if the control is part of a tab control, then I need:

    dialog.@(wTab).@(wControl).SetText(sValue)

    I could create complex decision code to determine which line of the above code is applicable, but I would rather not.

    Should I flatten out my entire control hierarchy to dialog.control?

    It sound like a good idea to me, but I'd like some input.

    Thanks
    JQ

  2. #2
    Member
    Join Date
    Dec 1999
    Location
    Seattle, WA
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: VB Object Hierarchy

    rock on. this is how I generally set up my frame as well. When I was doing VB (I'm doing web stuff now), I did find it handy to "hide" the vb frame objects by using slashes in the tags to flatten it, as you indicate.

    Also, if you do make a record data type that contains the controls on the page, just make sure that you name the window elements the same as the fields within the data record (perhaps with differences due to hungarian notation on the data members), so that when you write the Populate function, the code is that much tighter, e.g.
    <code><pre>
    for each sField in FieldsOfRecord(DATA_STRUCT)
    if this.IsDefined(sField)
    switch(ClassOf(this.@(sField))
    case "HtmlTextField", "MyHtmlTextField"
    this.@(sField).SetText(rData.@(sField))
    </code>
    ...etc.


    [This message has been edited by Matt Sullivan (edited 05-01-2000).]
    <BLOCKQUOTE]<font size=1 face=Verdana, Arial, Helvetica]quote:</font]<HR]It doesn't matter if I go to heaven or to hell, I have friends in both places.<HR]</BLOCKQUOTE]

  3. #3
    JQ
    JQ is offline
    Junior Member
    Join Date
    Jan 2000
    Location
    Maynard,MA,USA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: VB Object Hierarchy

    Thanks for the input! To be honest, I have written a function called PopulateDialog to be called from within a test case. I could write it as you have indicated, and define it as a method type meber of the base class. This way all of my dialogs inherit the method. Cool, but! (There's always a but).

    The issue I am struggling with is how to "operate" the dialog during population. Sometimes tabs need to be selected to expose controls. This is why I had written a function. I would "Populate" the dialog, return from the Populate function, Select the next tab, initialize the data structure, call Populate dialog again, etc....

    It would be really efficient if I could build some sort of procedural support into a "populate" method. I could use a flag or keyword in the data structure. What do you think? Were you able to address this issue?

    If I could solve this problem, I will attempt to code my smoke test using custom methods. Imagine: Dialog.SmokeIt()

  4. #4
    Member
    Join Date
    Dec 1999
    Location
    Seattle, WA
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: VB Object Hierarchy

    I guess I would recommend treating each tab as a unique entity, each with its own Invoke and Populate methods (the latter of which, as you indicated, can be declared by inheriting from the parent class.)

    If you find this too cumbersome, you could make a function to do all the tabs at once.

    This probably is more subjective than objective. The main thing is that you pick one way and standardize on it.

    (Funny, I have a generic method called SmokeFrame() so we're on the same track in this regards. I use it to insure that my tags are good as I define the frame file...)

    ------------------
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>It doesn't matter if I go to heaven or to hell, I have friends in both places.<HR></BLOCKQUOTE>
    <BLOCKQUOTE]<font size=1 face=Verdana, Arial, Helvetica]quote:</font]<HR]It doesn't matter if I go to heaven or to hell, I have friends in both places.<HR]</BLOCKQUOTE]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:47 PM.

Copyright BetaSoft Inc.