|Anonymous | Login||01-19-2020 09:41 UTC|
|Main | My View | View Issues | Change Log | Docs|
|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|
|Summary||0007200: [ENH] The dice rolling methods in random should be factored out|
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.
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|
|There are no notes attached to this issue.|
|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.