CodeCoupler UI Internals
This informations are used internally. Normally you never have to use this.
Async Contructor Pattern
The base class of all components implements an async constructor pattern. Classes derived from here can initiated with:
The constructor of the base class call for these async methods behind each other:
finalize methods are used internally by the base class and components. Classes
implemented by the user that derive from components have to implement their asynchronous
initialization procedure within the
1 2 3 4 5
prepare method receive the arguments as they are used in the instantiation of the class. In
most cases the components override the
prepare method to prepare the expected arguments or do
Normally the user does not instatiate a component directly, except for the
System component. He
use the component factory methods like
widget(). In these methods the
environment for the
prepare method will be prepared and the component will be instantiated. These
methods also take care of error handling if necessary.
If the return value of the
prepare method is
init will not be executed.
finalize method do receive the return value of the init method as first argument and the
return value of
prepare as second argument. The method will be only executed if
init do not throw any errors.
Whenever one of the methods
finalize will throw an exception, the promise
initialized will be rejected with a custom error type "ComponentInitError`. This error type do not
have a stack, because this stack would only include the trace inside of the construction construct.
It contains two properties with more informations:
cause: Contains the origin error that was thrown. If an error object was thrown you will find
here the relevant stack informations.
component: The component instance that throwed the