What is the SessionManager equivalent to `Smalltalk addToStartupList: self after: AnotherClass`? To do it manually, I don't see an easy way to query the priority/category of AnotherClass(edited) Also, it seems that "higher" priority in SessionManager means a lower number! This seems opposite of both logic and precedent (see Process), no? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Did you read the very nice class comment ?
On 17 Jun 2018, at 20:20, Sean P. DeNigris <sean@clipperadams.com> wrote:
What is the SessionManager equivalent to `Smalltalk addToStartupList: self after: AnotherClass`? To do it manually, I don't see an easy way to query the priority/category of AnotherClass(edited) Also, it seems that "higher" priority in SessionManager means a lower number! This seems opposite of both logic and precedent (see Process), no?
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean,
Le 17 juin 2018 à 20:20, Sean P. DeNigris <sean@clipperadams.com> a écrit :
What is the SessionManager equivalent to `Smalltalk addToStartupList: self after: AnotherClass`? To do it manually, I don't see an easy way to query the priority/category of AnotherClass(edited)
SessionManager was designed to avoid dependencies between classes / packages that have nothing in common. The best way is to find the best category to register your class in but in some cases, it s not enough. ex: you rely on a class registered in user category but you need that another class startup happens after. In this case, you need to use priorities. You can check dependent class category by inspection the session category but, indeed, there is no way to query the priority/category of a registered handler. It was not needed until now. Do you need to compute the priority dynamically? What is the use case?
Also, it seems that "higher" priority in SessionManager means a lower number! This seems opposite of both logic and precedent (see Process), no?
Youâre right. It simplifies sorting but indeed is counter-intuitive. Changing that now will probably break things for people relying on the current behavior. Cheers, Christophe
On Jun 19, 2018, at 2:50 AM, Christophe Demarey <christophe.demarey@inria.fr> wrote:
Le 17 juin 2018 à 20:20, Sean P. DeNigris <sean@clipperadams.com> a écrit :
Also, it seems that "higher" priority in SessionManager means a lower number! This seems opposite of both logic and precedent (see Process), no?
Youâre right. It simplifies sorting but indeed is counter-intuitive. Changing that now will probably break things for people relying on the current behavior.
I guess it seems intuitive to me that 1st place is higher priority than 2nd place or that 1 comes before 2. But you could add a new API with a number that gets translated to/from an internal value. That is the beauty of encapsulation. James Foster
demarey wrote
Do you need to compute the priority dynamically?
No. demarey wrote
What is the use case?
I have a domain representing servers that takes the following two steps at startup: 1. I use to store objects representing servers. SimplePersistence materializes saved Server instances, replacing existing instances 2. The Server class cycles through all instances in a collection to refresh their connection status. If #2 happens before #1, the old instances will be refreshed and then replaced by new unrefreshed ones. ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
participants (4)
-
Christophe Demarey -
James Foster -
Sean P. DeNigris -
Sven Van Caekenberghe