commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simonetrip...@apache.org>
Subject Re: [chain][v2] clever context
Date Sun, 04 Sep 2011 18:37:49 GMT
Couldn't find better words, big +1 to your words James!
All the best,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Sun, Sep 4, 2011 at 7:30 PM, James Carman <james@carmanconsulting.com> wrote:
> To be clear, I am also in favor of this approach.  I don't think we
> need to patronize our users by trying to hold their hands.  A
> ClassCastException would be a pretty obvious indicator as to what is
> going wrong with something like this.
>
> On Sun, Sep 4, 2011 at 12:13 PM, Matt Benson <gudnabrsam@gmail.com> wrote:
>> Obviously I've suggested this "auto-cast" or
>> whatever-you'd-like-to-call-it trick elsewhere, and am in favor of its
>> use.
>>
>> Matt
>>
>> On Sun, Sep 4, 2011 at 7:39 AM, James Carman <james@carmanconsulting.com> wrote:
>>> Yeah, I tried that sort of setup with the ArrayUtils.toMap() method
>>> and it was shot down
>>> (http://apache-commons.680414.n4.nabble.com/Re-svn-commit-r983137-commons-proper-lang-trunk-src-main-java-org-apache-commons-lang3-ArrayUtils-jaa-td2317854.html).
>>>  Good luck with that.  It wasn't worth my time to continue to argue
>>> about it anymore, so I reverted it.
>>>
>>> On Sun, Sep 4, 2011 at 5:22 AM, Simone Tripodi <simonetripodi@apache.org>
wrote:
>>>> Hi all guys,
>>>> I think that generics could help us on improving the Context class;
>>>> I'm not particularly happy having it extending Map - it is needed
>>>> anyway for backward compatibility - but it is clear that Context is a
>>>> place where storing/retrieving objects identified by a key.
>>>> I propose adding two helper methods
>>>>
>>>>    /** @since 2.0 */
>>>>    <T> T retrieve( String key );
>>>>
>>>>    /** @since 2.0 */
>>>>    <T> void store( String key, T object );
>>>>
>>>> that would help users avoid the redundant code of type cast/checking
>>>> when assignments are already known (it throws a ClassCastException if
>>>> types are not assignable).
>>>> At the same time, old pattern is supported, users can choose their
>>>> preferred way to go, depending on their needs.
>>>> WDYT?
>>>> Many thanks in advance, all the best!
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message