Extending the Protocol
From The Socknet
The Socknet protocol is extensible.
Contents |
Creating Functions
New Socknet functions can be created simply by documenting them and using them.
A function needs:
- A unique name
- Documentation
- A listing in the results of the functions function
Extending Requests and Responses
An object in JSON is an unordered set of name/value pairs.
There is no limit to the number of pairs it can have. The system using the object can ignore whichever pairs it doesn't know about.
This allows us to easily and safely extend the capabilities of functions.
In a function call, the request object or response object may have extra fields aside from the ones in the specification.
So all functions may be extended without breaking backward compatibility. If a field does not suit your purposes, you may add a new field and suggest its use to the community.
Getting Info on an Extension
If you discover that a Provider or Service offers an unknown function, you may call its functions function to obtain a URL to the documentation for that function.
If you discover that a Provider or Service offers unknown fields in its responses or requests, you may contact its administrators directly to ask about it. There information can be found via the contact function.
Naming
Names of functions and fields should be unique. See Namespaces for a simple way to make them unique in a similar manner to XML namespaces.
Considerations
If a new field has the same purpose as an old field, you should think twice. There may be a way to alter the old field without breaking backward compatibility. Specifically, if the old field is a string of XML, then you may want to extend that XML instead.
There is currently no repository listing extended functions or field names. But creating one wouldn't be a bad idea.

