Extension Interoperability


Why is it that extensions using common functionality must each implement that functionality individually? Why all of the redundant code? There are some times when it would nice if one extension could simply make use of some functionality in a different extension. Wouldn't that be nice? I'm not sure how much redundant code exists in the Click extension community, but I know that I personally have had to replicate Blowfish encryption in three objects. Why not just have the Blowfish object expose the algorithms to the other two objects and to all extensions in general? (See also: A Proposal for Encryption Objects)

The Problems

It's pretty clear why extension interoperability would be nice, but what are the drawbacks?

  1. An extension that requires four other extensions to work properly (and each of those four may require some more extensions) would be a burden to the user.
  2. Extension developers would need to be convinced to expose functionality, so doing it would need to be simple.
  3. Exposed functionality would need to be simple to use.

The Rules

In order to make this work, developers will need to adhere to some basic rules.

  1. An extensions should never require the functionality of another extension. Instead, extra functionality of an extension may require the functionality of another extension. For example, a data storing object that uses the Blowfish object to save encrypted files. By no means if the Blowfish object required to use the data storing object, but if it is present, the data storing object can then use it to save encrypted files.
  2. The method for exposing general functionality needs to be uniform (exposing specific functionality may have its own standards).
  3. Since exposed functionality will be in the form of pointers, developers will need to verify that the user actually sent correct interop information.

The InteropInfo Structure