Monday, December 15, 2003, 12:08:28 PM, Niclas Hedhman wrote:
> On Monday 15 December 2003 18:31, Daniel Dekany wrote:
[snip]
> Sorry, I don't even understand where (if) we disagree.
> The lookup( ROLE ) returns an implementation of a service interface, and such
> interface exposes the "Release Requirement" (suggested solution above).
And, I say that the release requirement should not bound to the service
interface, but to the role. This is where we disagree.
>> - When the "release requirement" bound to the Role, you can use
>> components of whatever lifestyle for that role, not only of lifestyle
>> that actually need "release requirement". This gives better separation
>> for implementation details. By declaring the Role as "has release
>> requirement", you say that for this role you potentially want to use
>> components that use on of these evil performance-optimized lifestyles,
>> but you can still use any component implementations there. You have just
>> allowed some extra lifestyles, such as "pooled", on the expense that you
>> will try{...}finally{release}.
>
> ... which (IMHO) say nothing about how you actually want it to be done.
>
> 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. 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).
--
Best regards,
Daniel Dekany
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]