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

  • From: "gogins@xxxxxxxxxxxx" <gogins@xxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Tue, 8 Feb 2005 19:49:25 -0500

Perhaps a more COM-like way to do this, is everything that comes out of a
factory is an interface.

/**
* Factory in a plugin library for plugins.
*/
class GMPI_IPluginLibrary : public GMPI_IUnknown 
{
 GMPI_Result GMPI_EnumeratePlugins(GMPI_PluginDescriptor *descriptor,
int32_t index);
};

Original Message:
-----------------
From:  jeffmcc@xxxxxxxxxx
Date: Wed, 09 Feb 2005 12:33:33 +1300
To: gmpi@xxxxxxxxxxxxx
Subject: [gmpi] Re: low level API - Abstract Factory summary


> HRESULT CreateFactory( CLSID clsidClass, IFactory**
 ppFactory );

Hi Ron,
 So each plugin has a unique ID code, we pass that to the
factory, it returns a GMPI_Plugin interface.  That's good...

But we first need the list of available IDs (in that dll).
So don't we need a second function too, that given an index,
returns the metadata for a plugin in the dll?

HRESULT GetGMPI_PluginDescriptor( int index,
IGMPI_PluginDescriptor **pd );

The metadata interface supplys the plugin's unique ID, it's
name etc.

Am I on the right track?

Jeff

PS: mayby replace HRESULT with GMPI_RESULT.

>
> >>>
> I think making it an object is just OO masturbation.  It
> feels good, but it doesn't really achieve anything.
> <<<
>
> The reason it seems overengineered is because the factor
> interface hasn't been defined properly.  I reall should be
> something like this:
>
> struct IFactory
> {
>     HRESULT CreateInstance( IUnknown** ppObj ) = 0;
> };
>
> HRESULT CreateFactory( CLSID clsidClass, IFactory**
> ppFactory );
>
> The idea is: a single module can be a factory for a
> variety of different classes.  You instantiate new objects
> of a class through the factory for the class, and you get
> the identify the factory by CLSID (GUID).
>
> ----------------------------------------------------------
> ------------ 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
>

----------------------------------------------------------------------
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


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



----------------------------------------------------------------------
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: