Command extension

If you have ever been looking at some documentation or discussion about NMDC, you probably have noticed that it’s not extensible (or at least easily).

But why isn’t it?

First of all, you have to understand that the protocol Jonathan Hess originally wrote wasn’t intended for third parties. There were no one that were supposed to look at the code or the traffic and say “hey! Shouldn’t we add this feature?”

With that in mind, let us get down to the technical stuff. When you send a command in NMDC, the other side “know” how to parse it because there have been discussion how commands are supposed to look like. Well, not really a discussion. More like “NMDC did it like that and we shouldn’t break backwards compatibility because we’d be breaking a lot of clients and hubs.” So, when a client or hub see information in a command it doesn’t understand, it will ignore the entire command or, hopefully though not likely, the bad part. The problem with this is that there’s no, and haven’t been any (as far as I know), discussion concerning extending certain commands. (Though, there’s eg $Supports which have been agreed, or forced by arne, to use certain rules when being extended.)

So, when you add something in NMDC, you will need to enforce and/or notify that change to other clients and hubs, since they will most likely break with your change. If you add something in ADC, you will not break clients or hubs since there’s a native requirement for receipents to handle unknown data. (However, of course, you will need to have the other clients and hubs understand your command if you intend for them to use it, too. You will never get away from this.)

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: