Hi ben I agree with you. I had the impression that many pragmaCollector methods would make sense in Pragma class level. Please continue your analysis. We should drastically clean SystemNavigation. - It should work on environment - remove all the browse behavior. Stef Le 10/9/15 17:22, Ben Coman a écrit :
The bootstrap-dependency graph and report [1] mark dependency System-Announcements --> PragmaCollector for pruning. This is due to...
SystemAnnouncer>>restoreAllNotifications | collector | self reset. collector := PragmaCollector filter: [ :pragma | pragma keyword = #systemEventRegistration ]. collector reset. collector do: [ :pragma | pragma methodClass theNonMetaClass perform: pragma selector ]
Browsing around I came to understand that PragmaCollector is useful as a pragma cache, but here the collector is thrown away, so that facility is not needed. A key part is "collector reset" which does... self class allSystemPragmas do: [:pragma | self addPragma: pragma]
where the #addPragma: evaluates the initialize'd #filter: block. Now it seems that #allSystemPragmas might fit nicely on Pragma rather than PragmaCollector such that the following should be equivalent...
SystemAnnouncer>>restoreAllNotifications | systemPragmas | self reset. systemPragmas := Pragma allSystemPragmas collect: [ :pragma | pragma keyword = #systemEventRegistration ]. systemPragmas do: [ :pragma | pragma methodClass theNonMetaClass perform: pragma selector
However #allSystemPragmas depends on SystemNavigation, so is it be okay for Pragma to depend on SystemNavigation?
Actually, class side of Pragma has several #named:in: like methods, so something like the following would be neat... SystemAnnouncer>>restoreAllNotifications self reset. Pragma allNamed: #systemEventRegistration do: [ :pragma | pragma methodClass theNonMetaClass perform: pragma selector ].
cheers -ben
[1] https://ci.inria.fr/pharo/job/Pharo-5.0-DependencyAnalysis/Dependencies_HTML...