avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: Context: usage recommendations? ( Re: [SUMMARY] Context )
Date Mon, 09 Dec 2002 02:47:45 GMT
> In a word no. Interfaces that define methods to get at data are just
> syntactic sugar. ie Whats the difference between
>
> 1. (String)context.get( "name.key" );
> 2. ((NameContext)context).getName();

As I believe I have repeatedly pointed out, these are not equivalent.  In
the latter case, the context is cast to a particular type, which means that
it must have an an inheritance relationship with the desired type.  In the
latter case, the context simply needs to have a reference to a suitable
object.

This extends to objects that provide services, not just simple data types.
IMO, the access mechanism provided to components should be DECOUPLING from
implementations, not COUPLING via inheritance.

	--- Noel


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message