Hello Leif!

0)

AT>(I hope my poor knowledge of terminology has not stopped me from
AT>being understandable here :)

LM> Not at all.  Your English is much better than my Russian. :-)  I can 
LM> relate when using my Japanese though :-)
It was not English, I do not know Phoenix terminology so I was
afraid that the terms I used instead will not be understood.
BTW, how are you getting on your katakana? :-)

1)

AT>Are the loops evil after all?
AT>
AT>Can there be a legitimate application where two components need
AT>to lookup() each other?
AT>
AT>The real trouble will happen if the components
AT>invoke each other during the "warmup" peirod.

LM> Actually, I don't think it should be up to the component to worry about
LM> when it can actually make use of components that have been obtained via
LM> a lookup. So I think it is good that the Container makes sure that components
LM> do no declare any loops.

Hmm... unfortunately this causes us to go into tricks like the one
you described with CA, CB, CD, CD

And this won't work at all for all the containers that enforce
the "you get only what you are allowed to" principle.

2)

LM> It should be possible to create a lookup counter that tracks the number
LM> of times that a component.  The counter would then be checked before a
LM> component was disposed and the counter would wait up to a timeout limit
LM> before disposing the component.  The container would prevent any new
LM> references to the component from being looked up once the shutdown
LM> process was initiated.

AFAIK

* ECM had this counter
* for Fortress a more advanced scheme was discussed
  that would build dependency graph

  Oh, dear what will it do if it detects loops there...

LM> Thoughts?

3)

BTW, look at what [EMAIL PROTECTED] has proposed
for Phoenix (my prev. mail had this in section 8)

Imagine we have components A, B, C.

We declare dependencies

   C -> A
   C -> B
   
Now, component C does

C::start() // sorry for C++ syntax :)
{
    m_a = m_sm.lookup( A );
    m_b = m_sm.lookup( B );

    m_a.takeB( m_b );

    // this far it has been what Peter has proposed, now
    // let's go one step further

    m_b.takeA( m_a );
}

then to make sure the order of decommission is correct we
might even do

C::stop()
{
    m_a.drop( m_b );
    m_b.drop( m_a );

    m_sm.release( m_a ); m_a = null;
    m_sm.release( m_b ); m_b = null;
}

Oh, dear. This shows that there is a way to deceive any
mechanism tracking dependencies and even not be hit by
a brick on your head.

But I do not like this at all.
In fact if A and B are not sigletones this will work
only if any requests to A and B arrive from or via C.

(Plz ask if I'm not verbose enough here, I want to
be understood.)

The funnies thing about it all is that [EMAIL PROTECTED]
offers a similar thing (wiring component B to A via component C)
as a perfectly legitimate approach for Phoenix.

It's option 3 in his mail.
(For Phoenix it is a little less bad as
with Phoenix everyone is a singletone.)

4)

But as I said I do not like very much to deceive anybody.
It would be nicer if not component C but regular container
mechanisms allowed us such component composition.

But I'm not sure haw viable it is.

Component C in this example has some intimate knowledge
of A and B and that's why the example works.

A general container does not this initmate knowledge,
unless we find a way to stuff it into the configuration,
which I do not see yet.

-Anton


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

Reply via email to