> Leo Sutic wrote:
> > Carsten,
> > 
> > you are right - everything gets a little bit more complicated.
> > 
> Yes, and this is the thing that worries me - I know a lot of people
> saying "Avalon is too complicated" and this makes it even a little
> bit more complicated,

hmm. Is it more complicated?

In practical terms, you currently do

compose( ComponentManager cm ) throws ComponentException
{
        m_cm = cm;
        m_comp = (BlaComp) m_cm.lookup( BlaComp.ROLE );
}
doStuff()
{
        m_comp.doABitOfStuff();
}
dispose()
{
        m_cm.release(m_comp);
}

which becomes:

compose( ComponentManager cm ) throws ComponentException
{
        m_comp = (BlaComp) m_cm.lookup( BlaComp.ROLE );
}
doStuff()
{
        m_comp.doABitOfStuff();
}

if your component is threadsafe. If it is not, and you wish to use it in
a multi-threaded environment:

compose( ComponentManager cm ) throws ComponentException
{
        m_factory = (Factory) m_cm.lookup( BlaComp.ROLE + "/factory" );
                // or something like that
}
doStuff()
{
        m_comp = (BlaComp)m_factory.getInstance();
        m_comp.doABitOfStuff();
        m_comp.release();
}

> And as a final argument against this is upgrading from 4.x to 5.0
> which not only requires recompiling, but also recoding (ok, this
> is acceptable if there are only a few cases) but even using a
> different pattern.

avalon framework is all about patterns. An upgrade to avalon framework
is either a bugfix (minor revision), added functionality (major
revision, perhaps one day for SEDA-like stuff) or a pattern upgrade
(major version change).

There is no way to improve patterns without recoding (though it might be
possible to write tools that automate most of the recoding).

cheers,

- LSD



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

Reply via email to