Le 30 oct. 08 à 15:53 (soir), Sam Rowlands a écrit:
Is there a way to create a class.parent without having a property
on the class?
For instance say I have a class called Engine, then I have an array
of Valve classes. The array is a property of Engine.
Engine.Valves()
However now I want the valve to communicate with the Engine, to
notify the engine when it fails, do I create a property on the
valve class called parent and set that to be my engine, or is there
some fancy trick I can use to probe the valve and figure it out?
Well, you might add a property to your valve class (done as boolean).
When the valve class has finished, you set it to true,
Then, on the engine class, you regularly loop thru all your valves
and see which have done=true.
Other than that, there are less elegant solutions, like using a
ICMPSocket to communicate (avoids memory leaks with references count)
or pass thru the app class (which is always open as long as your app
is, anyway).
Other than that... I don't know ;-)
Have a Great Week :)
Thanks, same to you (and everyone)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|