Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007200 [Squeak] Kernel minor N/A 09-23-08 00:57 09-23-08 00:57
Reporter wiz View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0007200: [ENH] The dice rolling methods in random should be factored out
Description The dice rolling code in Random needs to be factored out.

It does not depend on any ivar in random.
It calls random in only one place.

So it needs a generator of randoms.
It does not belong in random proper.

The first advantage is improved code smell.
The responsibilities belong to different classes.
Random should concentrate on providing random numbers.
DiceRollers should be able to use generators other than Random.

They were smooshed together during the first pass for the conveinence of the programer but this detriments code reuse and maintainability.


Additional Information I've uploaded DiceRoller-wiz.1.cs

This is a straight forward factoring out of the dice rollering code from Random.
It removes the methods from random and creates DiceRoller to contain them.
DiceRoller is given a generator which by default gets initialized to random.

Attached Files  DiceRoller-wiz.1.cs [^] (4,011 bytes) 09-23-08 00:57

- Relationships
child of 0007192new  A mother for issues with Random and random number generators in general 

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
09-23-08 00:57 wiz New Issue
09-23-08 00:57 wiz File Added: DiceRoller-wiz.1.cs
09-23-08 00:58 wiz Relationship added child of 0007192


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
37 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker