QotD    "To be or not to be" – Shakespeare
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Object class method systemStartupDependsOnMe
Last updated at 10:55 am UTC on 29 April 2019
A proposal from Mailing list 29th April 2019; to edit

cf command line scripts
Object class>>systemStartupDependsOnMe

"If it does, then override this method
     to notify yourself of at least one other class
     whose startup initialization you are certain you depend on.

 Something like

      self  startupDependsOn: aClassOrSomeClasses; 
            startupDependsOn: aClassOrSomeClasses2


^self startupDependsOn: #()

Some class>>systemStartupDependsOnMe

             self startupDependsOn: aClassOrSomeClasses

                     ; startupDependsOn: aClassOrSomeClasses2

                     ; ...

At startup, we send #systemStartupDependsOnMe

to all the classes which define it.

We then do a topological sort of the identified dependencies,

and send #initialize or whatever to each class in the resulting list.

If the ordering proves insufficient, we add dependency

corrections as and where they are discovered, and keep adding new ones

until we get a partial ordering that works.