commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [lang] Adding a Memoizer class
Date Wed, 10 Aug 2011 20:43:18 GMT
On Wed, Aug 10, 2011 at 3:38 PM, Oliver Heger
<oliver.heger@oliver-heger.de> wrote:
> Am 10.08.2011 01:23, schrieb Gary Gregory:
>>
>> On Tue, Aug 9, 2011 at 6:40 PM, Simone Tripodi<simonetripodi@apache.org>
>>  wrote:
>>>
>>> Good news! :)
>>
>> Well... I am having second thoughts now baed on Tim's reply:
>>
>> On Tue, Aug 9, 2011 at 6:13 PM, Tim Peierls<tim@peierls.net>  wrote:
>>>
>>> Probably not a good idea to use Memoizer unchanged from the book, though.
>>> See Guava's MapMaker for ideas about how to turn Memoizer into a
>>> production-ready utility.
>>>
>>> --tim
>>>
>>
>> Now I am thinking of dumping my Memoizer in favor of MapMaker... not
>> sure though. It seems smelly to bring in MapMaker into [lang].
>>
>> Thoughts,
>
> Just had a short glance on the API of MapMaker. My impression is that it is
> out of scope for [lang] as it is a full blown collection with many
> sophisticated features.
>
> Compared to this a Memoizer is a pretty simplistic component, but it may
> nevertheless be useful for some cases. It could be slightly extended, e.g.
> by providing a flush() operation.

Hi All:

I had a simple case to implement and using MapMaker was better that
the Memoizer I wrote. Just to flush (pun intended) things out with
some basic APIs like your flush() example quickly grows into a
MapMaker... I do not see the use case for a super simple MapMaker,
like something between a Java's ConcurrentHashMap and Guava's
MapMaker. I urge us to consider real use cases before adding this (I
know, I know, I am the one who proposed it.)

>
> And I would recommend another name. At least for me as non-native speaker it
> is hard to imagine what a Memoizer is supposed to do. I would probably use
> something with "Cache" in its name.

Yes, the name is a little obscure but describes the pattern correctly.
We could call it CacheSomething (the next release of Guava will have a
CacheBuilder class.)

The name will definitively reflect the usage POV but should not
present the class in a restricted way. Map is more general than Cache
for example.

Cheers,
Gary

>
> Oliver
>
>>
>> Gary
>>
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Tue, Aug 9, 2011 at 11:49 PM, Gary Gregory<garydgregory@gmail.com>
>>>  wrote:
>>>>
>>>> We are good! I asked Brian, one of the authors and the code is in the
>>>> public domain:
>>>>
>>>> On Tue, Aug 9, 2011 at 5:40 PM, Brian Goetz<brian@briangoetz.com>
>>>>  wrote:
>>>>>
>>>>> No license issues -- the code is in the public domain:
>>>>>
>>>>>    Written by Brian Goetz and Tim Peierls with assistance from members
>>>>> of
>>>>>    JCP JSR-166 Expert Group and released to the public domain, as
>>>>> explained
>>>>> at
>>>>>    http://creativecommons.org/licenses/publicdomain
>>>>>
>>>>>
>>>>> Code for the samples can be downloaded from
>>>>> http://www.jcip.net/listings.html.
>>>>>
>>>>> Cheers,
>>>>> -Brian
>>>>>
>>>>>
>>>>> On 8/9/2011 5:38 PM, Gary Gregory wrote:
>>>>>>
>>>>>> Hi Brian,
>>>>>>
>>>>>> I would like to include a Memoizer in the next release of Apache
>>>>>> Commons Lang [1].
>>>>>>
>>>>>> Can we use the Memoizer pattern from "Java Concurrency in Practice"?
I
>>>>>> think I would reuse the code from the class Memoizer and change names,
>>>>>> things like that.
>>>>>>
>>>>>> We are talking about this on the Lang mailing list and are wondering
>>>>>> if there are any licensing issues.
>>>>>>
>>>>>> [1] https://commons.apache.org/lang/
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you,
>>>> Gary
>>>>
>>>>
>>>> On Tue, Aug 9, 2011 at 5:06 PM, Gary Gregory<garydgregory@gmail.com>
>>>>  wrote:
>>>>>
>>>>> On Aug 9, 2011, at 16:28, Oliver Heger<oliver.heger@oliver-heger.de>
>>>>>  wrote:
>>>>>
>>>>>> Am 09.08.2011 20:57, schrieb Gary Gregory:
>>>>>>>
>>>>>>> Hello All,
>>>>>>>
>>>>>>> I am currently using a class like the Memoizer class [1] from
"Java
>>>>>>> Concurrency in Practice" [2], a great book.
>>>>>>>
>>>>>>> It would fit perfectly in org.apache.commons.lang3.concurrent.
>>>>>>>
>>>>>>> Any thoughts for or against?
>>>>>>
>>>>>> +1, this would be a nice addition to the concurrent package. Are
there
>>>>>> any licensing issues?
>>>>>
>>>>> Good question. It would not be a char for char copy but the pattern
>>>>> would be the same. I'll look around...
>>>>>
>>>>> Gary
>>>>>
>>>>>>
>>>>>> Oliver
>>>>>>
>>>>>>>
>>>>>>> Thank you,
>>>>>>>
>>>>>>> Gary
>>>>>>>
>>>>>>> [1] http://jcip.net/listings/Memoizer.java
>>>>>>> [2] http://jcip.net/
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you,
>>>> Gary
>>>>
>>>> http://garygregory.wordpress.com/
>>>> http://garygregory.com/
>>>> http://people.apache.org/~ggregory/
>>>> http://twitter.com/GaryGregory
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
>



-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

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


Mime
View raw message