about common command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

about common command

ducasse
Hi

I played a bit to turn smart suggestion actions into commander2 commands.
It works :).
Now with CM2 we do not have to have a class per command. We can create an instance. Now I was wondering what we prefer

- using classes
        + we can dispatch later (for example suggestions dispatch on nodes message to register to specific AST node
        and the new behavior can be plugged modularly using extension
        + free registration
        - we create one class per command

- using instances
        + no need to create one class.
        - we need to build a registration and query mechanism
        - extension will require to change or annotate somehow the created instances .

So I have the impression that using classes is better.

Setf