[ 
https://issues.apache.org/jira/browse/MAHOUT-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801750#action_12801750
 ] 

Sean Owen commented on MAHOUT-260:
----------------------------------

My take is that we have injection already, via RandomUtils. If the question is, 
can we do it more nicely? then I'd say the best hope is Guice, and the minimum 
effort required to use Guice is to rewrite every class that uses a RNG to take 
it as a constructor param, and add Guice annotations, and a config file, and 
Guice dependency. It doesn't change the functionality, and seems like work to 
go from something slightly complex, to complex.

But my big point here is none of that is actually addressing the real issue 
here, which is that even with injected RNGs, we have a test repeatability 
problem. My patch is attacking that issue, which exists with or without 
injection.

And actually even this change doesn't guarantee determinism, since we can't 
control randomness in libraries we use, though there may be none at the moment.

> An alternative approach to RNG management
> -----------------------------------------
>
>                 Key: MAHOUT-260
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-260
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.3
>            Reporter: Benson Margulies
>         Attachments: MAHOUT-260.diff, MAHOUT-260_wrapper.patch
>
>
> Here's code to (a) use the JDK for random numbers when testing, and (b) make 
> the RNG selectable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to