> > It looks good, but I really do not like the mass of castings begin done.
>
> The ability to do the cast requires an IS-A relationship.  I would prefer
> something like:
>
>      T t = (T) context.get(T.class);

Yes, but then you have the same number of casts. That is, for every
context-related operation, you have to do one cast. I much prefer
the user doing a single cast when receiving the context object,
and then having access to all allowed context-related operations
through that interface.

It is much clearer to be able to say that "you can cast the incoming
context to Blah, and there you have all operations you can do" instead
of saying "you can get at the following context keys Blah, Blah2, Blah3
... BlahN" and they will each provide you with one method.

As a bonus, you get the ability to deprecate context operations, plus
compile time checking of everything except the initial cast.

> Workable? :-)

Sure, but it has some overhead that I'd like to get rid of.

/LS


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

Reply via email to