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

Re: dlsym() and C++



Quoting Bert Peers (rat@larian.com):

> I'm not following here.  If you upgrade the *interface* you're
> adding new members, right, so you'll have to know the new
> interface to use it, wether you access it directly or through
> the Query...  Replacing the COM object to have a different
> implementation of the same interface is not really an
> upgrade from the client's point of view, it's rather
> maintenance; if you really want to use new functions you'll
> have to know them, the only difference between native C++
> and COM is that COM allows you to (truly) upgrade
> client and object independetly, typically first a new object,
> then the new client.

Unless you've stopped developing on your library, you'll always get more
class and functions. Let's take a surface in DirectX as an example. First
you have to use CreateSurface a surface from the IDirectDraw object - _then_
you need to do a query interface to get the actual surface interface you
wanted. With DirectX, almost every object now have 3-4 different versions of
the interfaces.
In DirectX, I once remembered doing 5 QueryInterfaces when loading a simple
texture - I don't want the users of ClanLib to experience that nightmare.

Maybe this can be avoided - and maybe DirectX doesn't use COM very well -
but I just don't like what I've seen...

-- 
Magnus Norddahl
ClanSoft