On Monday 15 December 2003 23:05, Daniel Dekany wrote:
> Monday, December 15, 2003, 12:08:28 PM, Niclas Hedhman wrote:
> > On Monday 15 December 2003 18:31, Daniel Dekany wrote:
> > How (explicitly) would the client code get to know if the "ROLE" would
> > "potentially" be depending on release()?
>
> The programmer knows that, similarly he knows what Roles exist and they
> do at all... human contract. "Guys, there is a Role 'Foo' available for
> this-and-that, and Role 'bar' for that-and-whaton. 

Ok, how does the container then know it? I assume you have in mind an 
attribute, in Merlin's case, in the block.xml where the tie between role, 
service and implementation is made...

> This latest role has
> release requirement.". If the programmer forgets about that,
> ServiceManager.lookup("bar") will throw exception, if you remember the
> my recommendation about lookup(role) vs
> lookupAndHold(role)+release(obj).

Don't like that pattern at all, and I think many hardcore Avaloners are on the 
track (not to introduce that).


Bottomline for me in this debate; 
LSDs point about "reflected" disposals or taking the tedium to write 
rock-solid code should be "strongly encouraged", is harmonizing pretty much 
with my views.
KISS, less magic at the expense of some verbosity (you only write code once, 
but probably read it dozens).

Cheers
Niclas

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

Reply via email to