[
https://issues.apache.org/jira/browse/LANG-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167697#comment-14167697
]
James Sawle edited comment on LANG-740 at 10/10/14 10:37 PM:
-------------------------------------------------------------
This is a proposed implementation of the Memoizer class for discussion. If
rough implementation agreed then tests will be generated during the
tidy-up/changes.
The class differs from the implementation by Goetz et al. by allowing the
setting of whether failed computations should be cached. This is mentioned as a
note in the book. The default behaviour is cache the values.
All checked exceptions thrown by a given calculation are wrapped as unchecked
IllegalStateExceptions, this is to allow for as lightweight an implementation
as possible. A checked Exception could be generated as a wrapper for the
Computable interface, and then used within the Memoizer as an alternative.
Any comments welcome.
was (Author: jamessawle):
This is a proposed implementation of the Memoizer class for discussion. If
agreed then tests will be generated.
The class differs from the implementation by Goetz et al. by allowing the
setting of whether failed computations should be cached. This is mentioned as a
note in the book. The default behaviour is cache the values.
All checked exceptions thrown by a given calculation are wrapped as unchecked
IllegalStateExceptions, this is to allow for as lightweight an implementation
as possible. A checked Exception could be generated as a wrapper for the
Computable interface, and then used within the Memoizer as an alternative.
Any comments welcome.
> Add a Memoizer class
> --------------------
>
> Key: LANG-740
> URL: https://issues.apache.org/jira/browse/LANG-740
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.concurrent.*
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Fix For: Patch Needed
>
> Attachments: LANG-740.patch
>
>
> 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.
> [1] http://jcip.net/listings/Memoizer.java
> [2] http://jcip.net/
> There is no licensing issue because the code is in the public domain:
> {noformat}
> ---------- Forwarded message ----------
> From: Brian Goetz <[email protected]>
> Date: Tue, Aug 9, 2011 at 5:40 PM
> Subject: Re: Apache Commons Lang and Memoizer
> To: Gary Gregory <[email protected]>, Tim Peierls <[email protected]>
> 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
> http://garygregory.wordpress.com/
> http://garygregory.com/
> http://people.apache.org/~ggregory/
> http://twitter.com/GaryGregory
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)