Re: IsValid(Object)
From: Peter Below (TeamB) (100113.1101_at_compuXXserve.com)
Date: 01/08/04
- Next message: Peter Below (TeamB): "Re: Multi Language"
- Previous message: valentin tihomirov: "Re: is it possible to create integer-variables with the standard value 0??"
- In reply to: David Frauzel: "IsValid(Object)"
- Next in thread: David Frauzel: "Re: IsValid(Object)"
- Reply: David Frauzel: "Re: IsValid(Object)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 08 Jan 2004 20:53:05 +0100
In article <Xns94698B1475D55nemoweathersongnet@207.105.83.66>, David Frauzel
wrote:
> I have a complex problem involving a linked list, a scripted for-loop, a
> reference to an object instance, and exception handling.
>
> The linked list is a hierarchy of objects, somewhat like the nodes on a
> TreeView. The class that represents the whole tree is TGffFile, and each
> node is a TGffField; effectively a "3 dimensional database".
>
> A part of the application sitting on top of these classes can be scripted
> to run a for-loop which iterates through all of the child fields of a
> given field. During every iteration, the current child is referenced as
> FGffContext, and the loop iterates by using:
>
> FGffContext := FGffContext.GetNextSibling;
> Looping = Assigned(FGffContext);
>
> Here's where the initial problem arises. The loop itself is a series of
> script commands that can arbitrarily modify the database. Which includes
> deleting arbitrary fields from the database. So, it's possible for a
> command in the loop to delete the field (or some parent of the field)
> referenced by FGffContext.
Sounds like a candidate for the Observer pattern. If the object holding the
FGffContext variable registers itself as an observer of the node the
variable points to it can get informed by said node object when it dies and
set the variable to nil.
-- Peter Below (TeamB) Use the newsgroup archives : http://www.mers.com/searchsite.html http://www.tamaracka.com/search.htm http://groups.google.com http://www.prolix.be
- Next message: Peter Below (TeamB): "Re: Multi Language"
- Previous message: valentin tihomirov: "Re: is it possible to create integer-variables with the standard value 0??"
- In reply to: David Frauzel: "IsValid(Object)"
- Next in thread: David Frauzel: "Re: IsValid(Object)"
- Reply: David Frauzel: "Re: IsValid(Object)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|