DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Re: how to structure an object hierarchy in VB ?

  1. #1
    - John of Arc - Guest

    Re: how to structure an object hierarchy in VB ?

    Thank you very much.

    First thing anyone's said on the subject. I appreciate the commentary.


    Frode Gilberg <frode@devplace.com> wrote in message
    news:38c8bb36$2@news.devx.com...
    > Hi,
    >
    > >Where should the root object(s) be stored? As global object variables?

    >
    >
    > Try to avoid global object variables. I usually, have one multiuse

    object -
    > The
    > LogOn object, which in turn return's a new root object through one of it's
    > methods
    > (typically the LogOn method)
    >
    > The next "root"-object (Application object?), includes cached data
    > (static/dynamic data collections) and search functions that return
    > new root-objects (dynamic data).
    >
    > >How should one handle garbage collection, object variable destruction?

    >
    >
    > For each new record read from the database, the dynamic data cache is
    > updated
    > for objects already read from DB, and new ones are added to the dynamic
    > cache.
    >
    > Cleaning up can be a problem tho. I'm currently trying to solve this by
    > traversing the
    > dynamic data collection (cache) before new data is read, checking every
    > object's instance
    > refcount value (using the memcopy technique). If refcount=1 (only

    referenced
    > by the
    > dynamic cache), it will be removed from the cache. I've heard that
    > the refcount is unreliable, so my question is : is it just as unreliable

    for
    > in-proc servers
    > as for out-proc servers? Comments on this approach is appreciated.
    >
    > >What stock objects should an application have? Application/Session?

    User?
    > >etc.?

    >
    >
    > How many do you need?
    >
    > >How much should a sub main() or startup form do? Should it only

    > instantiate
    > >the main objects and then let them do their thing?
    > >Or should it use them as is needed, creating and destroying them?

    >
    >
    > Avoid using forms in AxDLL's. Sub Main usually contains no code.
    >
    > >Thanks for any suggestions, web sites, samples, pointers, advice, book
    > >suggestions, discussion, etc. Or pointers to other threads on this list.
    > >

    > Wrox wrox wrox
    >
    > /Frode
    >
    >




  2. #2
    Frode Gilberg Guest

    Re: how to structure an object hierarchy in VB ?

    Mark,

    Thanks ! Yes, it's the method he mentioned it in his book, I meant. Was
    afraid it wasn't realiable. Think I should try to figure out another way to
    do it. I could create my own generic "AddRef" and "Release" function,
    keeping the count in an array or something. Big memory leak and bug
    potensial, tho. . The object model I'm currently working on is too
    complex for a traversing function to check what object references are being
    used (takes too long to execute), so I'm desperatly trying to find an
    effective method. Any ideas? Anyone?

    /Frode

    Mark Alexander Bertenshaw <Mark.Bertenshaw@virgin.net> wrote in message
    news:38ca7f4d@news.devx.com...
    > Frode -
    >
    > If you are talking about the technique suggested by Bruce McKinney, then I
    > have to say that it is very unreliable. In fact, in one project I created
    > it was 100% unreliable.
    >
    > Mark Alexander Bertenshaw
    > Programmer/Analyst
    > Prime Response
    > Brentford
    > UK
    >
    > > If refcount=1 (only referenced
    > > by the
    > > dynamic cache), it will be removed from the cache. I've heard that
    > > the refcount is unreliable, so my question is : is it just as unreliable

    > for
    > > in-proc servers
    > > as for out-proc servers? Comments on this approach is appreciated.
    > >

    >
    >
    >




  3. #3
    - John of Arc - Guest

    Re: how to structure an object hierarchy in VB ?


    Can you simplify and flatten the object model?

    Frode Gilberg <frode@devplace.com> wrote in message
    news:38cc2120@news.devx.com...
    > Mark,
    >
    > Thanks ! Yes, it's the method he mentioned it in his book, I meant. Was
    > afraid it wasn't realiable. Think I should try to figure out another way

    to
    > do it. I could create my own generic "AddRef" and "Release" function,
    > keeping the count in an array or something. Big memory leak and bug
    > potensial, tho. . The object model I'm currently working on is too
    > complex for a traversing function to check what object references are

    being
    > used (takes too long to execute), so I'm desperatly trying to find an
    > effective method. Any ideas? Anyone?
    >
    > /Frode
    >
    > Mark Alexander Bertenshaw <Mark.Bertenshaw@virgin.net> wrote in message
    > news:38ca7f4d@news.devx.com...
    > > Frode -
    > >
    > > If you are talking about the technique suggested by Bruce McKinney, then

    I
    > > have to say that it is very unreliable. In fact, in one project I

    created
    > > it was 100% unreliable.
    > >
    > > Mark Alexander Bertenshaw
    > > Programmer/Analyst
    > > Prime Response
    > > Brentford
    > > UK
    > >
    > > > If refcount=1 (only referenced
    > > > by the
    > > > dynamic cache), it will be removed from the cache. I've heard that
    > > > the refcount is unreliable, so my question is : is it just as

    unreliable
    > > for
    > > > in-proc servers
    > > > as for out-proc servers? Comments on this approach is appreciated.
    > > >

    > >
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center