[gmpi] Re: low level API - Abstract Factory summary

  • From: "B.J. Buchalter" <bj@xxxxxxxxxx>
  • To: "gmpi@xxxxxxxxxxxxx" <gmpi@xxxxxxxxxxxxx>
  • Date: Sat, 12 Feb 2005 13:56:18 -0500

on 2/12/05 2:00 AM, Tim Hockin at thockin@xxxxxxxxxx wrote:

> On Fri, Feb 11, 2005 at 11:29:28PM -0500, B.J. Buchalter wrote:
>> on 2/11/05 10:45 PM, Tim Hockin at thockin@xxxxxxxxxx wrote:
>> 
>>> And While I think about it - if we don't have multiple interfaces, what's
>>> the point of having QueryInterface() at all?
>> 
>> Versioning of an extensible interface:
>> 
>> kGMPIInterface_v1
>>     -- supports the first 100 api methods
>> kGMPIInterface_v2
>>     -- adds three more api methods (e.g. fully encompases kGMPIInterface_v1)
>> kGMPIInterface_v3
>>     -- adds 10 more api methods (e.g. fully encompases kGMPIInterface_v1+2)
>> 
>> In this model, the implementation simply keeps adding more methods to the
>> end of the vtable. It always returns the complete current vtable. But it
> 
> That's a lot of work to replace a single member variable which holds the
> GMPI_API_VERSION, isn't it?

Seems like it, but QI is required for COM; again, think languages like
Visual Basic; I'm pretty sure that if these plugins are really COM
compliant, that you would be able to use them from VB or any of those COM
supporting languages. If they are not COM compliant, I don't think you would
be able to do so (but I am speculating here).

OTOH, it protects against mistakes; essentially it stong-types the Interface
instead of weak-typing it. If a host is built when GMPI v3 is in existance,
and utilizes the v3 API, and is tested with v3 plug-ins, but the only way to
know which version of the API the plug-in supplies is a version number, it
is possible that the host fails to check the version number of the API
support and crashes hard when it tries to use a v2 or v1 plug. If the API is
versioned through QI, the host will fail to acquire an interface for v3 on a
v1 or v2 plug; at this point it will know that it can't use that plug (just
as if the plug had failed to load for any number of other reasons).

Anyway, it may be that we really do want multiple disjoint interfaces on the
GMPI_Plugin object. But there is some implementational complexity that
appears to be related to doing that....

Best regards,


B.J. Buchalter

Metric Halo
5 Donovan Drive
Hopewell Junction, NY 12533 USA
tel +1 845 223-6112
fax +1 603 250-2451


----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: