You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it should be documented that all Command constructors run when the first Command is invoked.
Rationale: In most (all?) current multi-command extensions, each command does its own Dependency Injection (DI). In almost all cases there is no need for this. If no constructor is dependent on the DI then the DI can be done in any one command and the other command constructors do not have to be littered with the DI parameters and associated setting of fields/properties associated with the DI.
In my case, I have a non-invocable DependencyInjectionCommand whose constructor sets fields/properties in the class derived from Command from which all the Commands in the extension derive.
In the Samples, the CommentRemover can be easily modified to accomplish the above, thus fulfilling 2 objectives for it.
Note: If all the commands derive from a parent (P) which in turns derives from Command I would suggest keeping/making P abstract for the reason I will note in my next issue.
The text was updated successfully, but these errors were encountered:
I think it should be documented that all Command constructors run when the first Command is invoked.
Rationale: In most (all?) current multi-command extensions, each command does its own Dependency Injection (DI). In almost all cases there is no need for this. If no constructor is dependent on the DI then the DI can be done in any one command and the other command constructors do not have to be littered with the DI parameters and associated setting of fields/properties associated with the DI.
In my case, I have a non-invocable DependencyInjectionCommand whose constructor sets fields/properties in the class derived from
Command
from which all the Commands in the extension derive.In the Samples, the CommentRemover can be easily modified to accomplish the above, thus fulfilling 2 objectives for it.
Note: If all the commands derive from a parent (
P
) which in turns derives fromCommand
I would suggest keeping/makingP
abstract for the reason I will note in my next issue.The text was updated successfully, but these errors were encountered: