On Wed, 13 Feb 2002 01:06, giacomo wrote:
> > My current avalon-related project is to port Avalon to C++, as I firmly
> > believe that the patterns used in Avalon can be reapplied in C++ and in
> > other areas than server side programming. The attempt has stalled due to
> > workload, but I intend to push it forward as soon as possible.
>
> Hmm... there is no easy way to change implementation of roles in a
> dll/so environment, isn't it?

I don't know about *easy* but it is possible. Basically when every .dll/.so 
is loaded you can check to see if it exports any types. So I used to use 
something like

export "C" TypeInfo[] scsLoadRegisteredTypes()
{
  return new TypeInfo[]
  {
    new TypeInfo( "MyTypeName", &CreateMyTypeMethod )
  };
}


static IUnknown CreateMyTypeMethod()
{
  return new MyType();
}

The IUnknown interface then had methods for reference counting and discovery 
of interfaces that the object implemented. It looks complicated but it could 
be mostly hidden behind macros and seems to work well. It is a very similar 
strategy to MSes COM system.

-- 
Cheers,

Pete

---------------------------------------------------
"If you don't know where you want to go, we'll make 
sure you get taken." 
Microsoft ad slogan, translated into Japanese.
---------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to