1

Closed

ICommand collides with .Net ICommand Interface

description

.Net already has an ICommand inteface. It would be good to rename yours to avoid confusion and naming collission issues.
Closed Jan 24, 2013 at 9:07 PM by polo
Since v.1.13 there is IMcmCommand instead ICommand

comments

polo wrote Jan 24, 2013 at 6:03 AM

I'm sorry, you have not convinced me yet. Can you explain where does the Mcm.ICommand make a collision with System.Windows.Input.ICommand? A code example? Where do you make a directly reference to Mcm.ICommand?

Custom commands are derived from Mcm.Command<TArgument, TResult> not from Mcm.ICommand directly.
public class LoginCommand : Command<LoginCommandArgument, LoginCommandResult>
If using Mcm.ICommand directly irritates you, I would suggest deriving an interface or a class from Mcm.ICommand and using it in you framework as a base for all custom commands.
public interface IAustinCommand : Mcm.ICommand
public class AustinCommand : IAustinCommand
Additionally there is no guarantee, if I rename Mcm.ICommand this will not collide with future .NET versions

In .NET 2.0 i could use command, but in .NET 3.0 the ICommand was introduced. So I could rename it to a Task, but in .NET 4.0 the Task class was introduced. I think we have to rely upon namespace differentiation, sorry.

AustinHarris wrote Jan 24, 2013 at 2:49 PM

I was just trying to help your framework be more usable. I realize there are workaround for fixing the confusion around your ICommand interface, but its silly for a new framework to not take those issues into consideration.

Expecting everyone to implement your Command<Targs,Tresult> base class on their commands is a pretty big assumption.

If I have existing commands already built using the .NET ICommand in a current project, then trying to use your framework requires rewriting EVERY command. It just too much work. It makes your framework not practical for use in an existing project.

Then there is the issue of being forced to create 3 classes for every command I want to create. That makes the code huge and bloated to just do a few simple commands.

I walked through your hello world example, and before I got to the end I already had 100 lines of code. :(