[PEAK] uponAssembly execution order

Phillip J. Eby pje at telecommunity.com
Tue Sep 26 15:49:33 EDT 2006


At 09:45 PM 9/26/2006 +0300, alexander smishlajev wrote:
>hello!
>
>we've got a problem with "uponAssembly" binding evaluation order.
>
>we have a component base class that performs some initialization tasks by 
>a procedure run from binding.Make with uponAssembly=True.
>
>there is a subclass to this base class which runs a tasklet (microthread, 
>if i remember PEAK terminology correctly).  the task is started by 
>binding.Make with uponAssembly=True.
>
>the problem is that the tasks starts before the component is properly 
>configured.  is there any way to straighten this?

Have the task that needs the component, refer to the attribute that does 
the initialization.

Remember that uponAssembly simply causes the atribute to be accessed, 
thereby firing the binding.Make.  So, simply by explicitly accessing that 
attribute, initialization is ensured.

Of course, you should probably do this in the relevant attributes on the 
component that needs initialization, so that this implementation detail 
isn't exposed to other components.




More information about the PEAK mailing list