Login  Register

Re: Package postInstall or Class initializeAfterLoad

Posted by Esteban A. Maringolo-3 on Oct 24, 2005; 12:46pm
URL: https://forum.world.st/Package-postInstall-or-Class-initializeAfterLoad-tp3375984p3375992.html

Udo Schneider escribió:
> 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.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.

Another solution which is a mix between Chris' class method and
Udo's postInstall script
is to reify the initialization/install as a class, which belongs to
the package.

In this way you put in your postInstall script:

YourPackageInstaller new setUp


Then, you can develop all the complex start up and shut down,
testing, and assertions needed
to activate (or not) your package, but you can develop it using the
standard development tools
(i.e. class browser, etc). And not as a single script in a
workspace. Plus, you can version it,
test it, and similar.

Best regards.

--
Esteban.