I prefer the injection method as well. On Sun, Jan 17, 2010 at 7:51 PM, Drew Farris <drew.far...@gmail.com> wrote:
> > If we want to go in Drew's suggested direction, we have to decide what > > to do about seeds. We either need to define an > > 'RandomNumberGeneratorFactory' interface which takes seeds and return > > generators, or we want to inject Random objects and expect the > > injector to worry about constructing and dealing with seeds. > > I vote for the latter. Those Random objects could be created via a > factory by whomever is injecting them. > > FWIW, RandomNumberGeneratorFactory pretty much exists today as > RandomUtils, I suspect we would just want to get rid of the static > boolean that determines whether a test seed or random seed is used for > getRandom(). -- Ted Dunning, CTO DeepDyve