<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 30 Apr 2019, at 0:15, Keith wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">Years ago I was trying to rationalise all the various functionality of Smalltalk/SmalltalkImage across<br>
forks. I also wanted to support a scheme that would handle being bootstrapped from sources.<br>
<br>
i.e. the startup process may load in or unload a number of classes from sources at an early stage, and when the time came to think about #startUp they may not have been #initialised, (the #startUp might be their initialisation).<br>
<br>
So I vaguely recollect that when I had a go at re-doing the startuplist I removed this responsibility to a class of its own, called StartupManager, and removed the class var that holds the list in favour of a voting system.<br>
<br>
I found some code hiding away (somewhat obfuscated)<br>
<br>
<a href="https://bazaar.launchpad.net/~keithy/cuis/System-Support_StartupManager/revision/1#StartupManager-into-Cuis2/1-System-Support-StartupManager.install/0002/StartupManager-(startup-shutdown)-int.1.st" style="color:#777">https://bazaar.launchpad.net/~keithy/cuis/System-Support_StartupManager/revision/1#StartupManager-into-Cuis2/1-System-Support-StartupManager.install/0002/StartupManager-(startup-shutdown)-int.1.st</a><br>
<br>
Looking through the comments I find<br>
<br>
StatupManager<br>
<br>
New simple startUp shutDown protocol<br>
<br>
classes implement #startUpPriority #shutDownPriority to register.<br>
Note: this code could be hosted on a different class, such as SmalltalkImage,<br>
<br>
The startUp and shutdownLists are compiled by looking at all implementors of:'<br>
#startUpPriority and #shutDownPriority'<br>
Priorities are: #first #earliest #earlier #early #normal #late #later #latest #last'<br>
<br>
As you can imagine this was very much a first attempt at resolving these problems.<br>
<br>
Keith</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">One of the other goals was to support removable/loadable UI in the bootstrap process</p>

<p dir="auto">I found this code in there, which indicates that the vote was essentially on a numeric 0-999 scale.</p>

<p dir="auto">StartupManager class methodsFor: 'system-startup-shutdown' stamp: 'kph 2/4/2010 16:44'!"</p>

<h1 style="font-size:1.4em">priorities</h1>

<p dir="auto">^ IdentityDictionary new</p>

<p dir="auto">at: #first put: 0; "reserved for Delay"<br>
at: #earliest put: 10;<br>
at: #earlier put: 100;<br>
at: #early put: 200;<br>
at: #normal put: 500; <br>
at: #late put: 800;<br>
at: #later put: 900;<br>
at: #latest put: 990;<br>
at: #last put: 999;  "reserved for Delay"<br>
yourself.</p>

<p dir="auto">and some code, sorting on given priority value, followed by class name.</p>

<p dir="auto">startUpList</p>

<p dir="auto">| priorities list |</p>

<p dir="auto">priorities := self class priorities.<br>
list := SortedCollection sortBlock: [ :a :b | <br>
    a value = b value <br>
        ifFalse: [ a value <= b value] <br>
        ifTrue: [ a key name <= b key name ] ].'</p>

<p dir="auto">self systemNavigation allClassesRespondingTo: #startUpPriority<br>
    do: [ :cl | list add: (cl -> (priorities at: cl startUpPriority ifAbsent: [ cl startUpPriority ] )) ].</p>

<p dir="auto">^ list</p>
</div>
</div>
</body>
</html>