No. 1)
Just checking the core code (v2.2) and there's the following referential integrity checks in types.delete():


// if this objecttype is used in tree, then it may have been used as a related link in dmHTML_aRelatedIDs
if (structKeyExists(application.types[stObj.typename],"bUseInTree"))
{
if (isBoolean(application.types[stObj.typename].bUseInTree) AND application.types[stObj.typename].bUseInTree)
{
oHTML = createObject("component",application.types['dmHTML'].typepath);
oHTML.deleteRelatedIds(objectid=stObj.objectid);
}


        }

If you have a custom type which references other objects this delete code won't help you.
Overriding your custom types delete method won't do anything, because it's the referenced object's delete method that gets called.


The fact that this is dmHTML specific code in dmHTML's supertype should have set off alarm bells...

Maybe there needs to be a notification sent to all types when any object gets deleted? Either this, or some system level reference tracking (I vote for the former).

No. 2)
Have a look at the following code in types.delete():

//Clean up containers
lTypesWithContainers = 'dmHTML,dmInclude';
if(listContainsNoCase(lTypesWithContainers,stObj.typename))
{
oCon = createObject('component','#application.packagepath#.rules.container');
oCon.delete(objectid=stObj.objectid);
}


Now if you have a custom type with a displayMethod containing a rule then this won't get called either. This limiting only to dmHTML and dmInclude seems only an optimisation, because AFAIK oCon.delete() doesn't care whether there's any container instances for the object -- it will just delete any it finds.

Wouldn't it be best to eliminate this type check altogether and just call oCon.delete() regardless?

-- tim lucas

http://www.toolmantim.com


--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to