Re: "Russian doll" class
From: Larry Serflaten (serflaten_at_usinternet.com)
Date: 03/10/04
- Next message: Neil Fallon: "Re: mouse wheel"
- Previous message: Paul: "Re: Drag from FileListBox, drop on DirListBox?"
- In reply to: Nick Cranham: "Re: "Russian doll" class"
- Next in thread: Nick Cranham: "Re: "Russian doll" class"
- Reply: Nick Cranham: "Re: "Russian doll" class"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 00:22:12 -0600
"Nick Cranham" <TungCheeWah@Invalid.com> wrote
> Larry,
> Thanks for your reply. I thought circular references may prove a concern in
> this situation. Seem to have fixed that by adding a method to the class,
> allowing the Class_Terminate to function as expected:
>
> Public Sub DeleteReferences()
In .Net they have a routine to release references, you might want to borrow
that name (Dispose) just to get used to the nomenclature... ;-)
> Using strings would simplify matters so I'll look into your method below.
> from how I read it though, I would need to hardcode some kind of structure
> to the collections, otherwise I cannot tell that the "B" child items belong
> to the "Boxes" collection. As the aim was to provide for an arbitray
> structure, that was one reason to go the object route.
The boxes were the lowest items in the heirarchy, so they would always
be some object's child. The collections were to keep things separate.
All box items go in the Box collection, all container items into the
Container collection and so on. A box's parent could be a container
or a pallet (or whatever, the arbitrary aspect) which means a box might
have a parent key of C-### where there is a C-### in the Containers
collection or a box might have a pallet for a parent with a key of P-###.
Items that can have kids would need a collection of keys as one of their
properties.
So if a box (B_001) has a parent in the pallet collection (P-021) that
pallet item would have a collection of kids of which the box's key
was a member. The letter prefixes simply let you know which collection
the item resides in and the numbers would have to be unique (to that
group at least) or some other form of GUID.
But it is just as well you break the cross referencing and use the
object methods, because collections have performance issues when
the number of members get to be in the thousands. (I happened to
think of that later in the day. The number of box items in all the cartons,
on all the pallets, in all the containers might easily get to be quite large.)
Good luck!
LFS
- Next message: Neil Fallon: "Re: mouse wheel"
- Previous message: Paul: "Re: Drag from FileListBox, drop on DirListBox?"
- In reply to: Nick Cranham: "Re: "Russian doll" class"
- Next in thread: Nick Cranham: "Re: "Russian doll" class"
- Reply: Nick Cranham: "Re: "Russian doll" class"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|