2017-04-11 17:34 GMT+02:00 Alexandre Bergel <alexandre.ber...@me.com>:

> Was is really necessary to introduce pragmas here?
>

In short: Commander needs pragma to query methods for command lookup. What
alternative you could suggest?

In details:

Commander caches all activators for each command class. It searches all
methods which supply them using pragma and store all retrieved instances in
class variable.

To lookup required commands users enumerate cached activators declared for
given context:

activatorClass allDeclaredFor: aToolContext do: blockWithActivator

This process is fast and not produces any garbage.

Also activation methods are supposed to be packaged together with
application which provide context for them. They can be in different
package than commands.
Commands are reusable and can be extended by multiple applications with
different set of activation methods.
For example in Calypso I will extract separate SystemCommands package which
can be reused by other tools like inspector and debugger. And Calypso will
"attach" these commands by own set of extension methods.

Reply via email to