discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plugin architecture design


From: Gregory Martin Pfeil
Subject: Re: Plugin architecture design
Date: Mon, 6 May 2002 23:55:29 -0700

On Tuesday, April 30, 2002, at 07:49  AM, e.sammer wrote:

Stephen Brandon wrote:
Versioning
------------
I have also thought about the need for versioning the API - if the API evolves we don't want to break old plugins. So perhaps we publish an API in the MK with textual/numeric tags, which the plugin can return in a dictionary when loaded, corresponding to which APIs it supports.

I would think that the best way to support versioning of the protocol or plugin api would be to have a protocol method the plugin would have to implement that returns the version of the api like:

@protocol MusicKitPlugin
+ (NSString*)protocolVersion;
@end

This way, the plugin could do things like forwardInvocation if it wants to dynamically "alter" it's protocol version. Another idea might be to query the delegate for which protocol version it wants and go from there.

I've always felt that the best way to support versioning is a method like:

+ (bool) supportsVersion: (NSString) version;

That way, an implementation can support multiple versions of the protocol, and a sort of negotiation can go on. The application can check against its preferred version, then fall back on other versions (after checking to see if they're supported) if the preferred one isn't.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]