> From: Stephen McConnell [mailto:[EMAIL PROTECTED]]
> 
> In such a scenario, I would put in place a test case that did the 
> casting - and avoid object activation whenever possible.  For 
> example, I 
> will typically use the methof hasService( key ) on the 
> ServiceManger to 
> validate that the key is available - but I will pass on the service 
> manager to subsidiary components without actually getting the 
> value of 
> the key - that because in the assembly API service don't get 
> activated 
> until they are actually needed - that makes lookup an expensive 
> operation on the first hit operation.  What would be better in that 
> scenario would be a hasService( key, class ) method where class is 
> parameter that is the target cast class and the implementation of the 
> service manger can validate if the candidate object 
> implements the class 
> without necessarily instantiating it.
> 
> The same logic applies to a new or revised context interface.

It is still a fragile contract.

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

Reply via email to