Re: IsValid(Object)

From: Peter Below (TeamB) (100113.1101_at_compuXXserve.com)
Date: 01/08/04


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


Relevant Pages

  • Re: window object
    ... Within a script, every reference to an object amounts to two ... calls from the scripting engine to the DHTML Object Model. ... var sText = document.all.div1.innerText; ...
    (comp.lang.javascript)
  • Re: Decoupling javascript from UserControls
    ... still be able to reference the server-generated IDs. ... your server-side code emit a simple bit ofJavaScriptthat merely writes out ... (where JavaScriptSection is a Literal, ... generation in the markup and set vars as you mentionend in the Render ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to catch error message instead of printing to stderr for rmtree
    ... script and CPAN's documentation. ... it still print the error message to stderr. ... to hold a reference to a variable, which will be used to store the ...
    (perl.beginners)
  • Re: What does this script means?
    ... write it in the global part of the script, ... it is perfectly valid to use a function reference as the operand ... Array in the original code). ...
    (comp.lang.javascript)
  • write to eventlog or filesystem on remote machine in system context
    ... i have a rather complex problem. ... a software via Microsoft SMS and I want to log the success/failure of ... the script on a remote machine. ...
    (microsoft.public.scripting.vbscript)