[Pharo-project] Playing with a declarative startup/shutdown subscription mechanism
eliot.miranda at gmail.com
Mon Aug 6 22:09:35 CEST 2012
On Sun, Aug 5, 2012 at 2:15 PM, Guillermo Polito
<guillermopolito at gmail.com>wrote:
> Last days I was playing to replace the image startup/shutdown mechanism
> via a pragma subscription because I was pissed off with how difficult is to
> integrate the change of a new startup in the system. The idea is:
> - reduce the mess on subscription/unsubscription, initialization, etc
> - reduce dependencies of external packages in core packages.
> This way, if you want to subscribe a class side method to be executed on
> startup, you annotate it:
> SomeClass>>startUp: resuming
> <systemStartup: #application>
> self blahblah.
> SomeClass>>startUp: quitting
> <systemShutdown: #kernel>
> self blahblah.
You need before: and after:. IMO, you also need to support multiple
befores or afters. I think that's much better than a priority scheme.
Also, as I said in response to Igor's message, you can register when pragma
methds are added/removed, rather than looking for methods when
initialization/shutdown is run.
> Now, instead of an order in classes startup, I played with the idea of
> having run levels (which I named #kernel, #application and #user because I
> was not inspired :P). Then I replaced the whole system startup and It's
> The code is very simple, you can have a look at the category *System-Tasks
> * which can be downloaded from:
> location: 'http://ss3.gemstone.com/ss/PharoTaskForces'
> user: ''
> password: ''
> Be careful, that package contains the startup code + the replacement of
> the old startup by the new one :).
> Now, I'd like to have some feedback, u like it? u buy it? which should be
> the names for the run levels? how many run levels should we have? :P
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project