Login  Register

Re: Package postInstall or Class initializeAfterLoad

Posted by Udo Schneider on Oct 24, 2005; 12:27pm
URL: https://forum.world.st/Package-postInstall-or-Class-initializeAfterLoad-tp3375984p3375991.html

Chris Uppal wrote:
> BTW, even in that case, I would put the code for the system-wide initialisation
> into a class-side method somewhere, and the post install script would simply
> invoke that.  There's no point in putting complex code in a post-install
> script.
I've made somewhat different experiences. My class initialization takes
initializes only the classes themselves and does not refer to other
classes of the package. The reason for that is that I made the painful
experience that you can not rely on class loading order.

I.e. if I need to wire up some classes from the package I do this in the
postinstall script - thus being sure that all classes are loaded.

The other use is initialization which does not belong to any class.
Prominent example is extending View's MessageMap to handle additional
windows messages.

CU,

Udo