"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Dennis Deems wrote:Also, I suggest creating a Color enum instead of hard-coding Strings.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Jk Robbins wrote:I see that you are also implying the use of the Decorator pattern.
One reason I'm storing all the data in a single object is so at the end I have 5 beans that can put in the request for the jsp.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Alexei Kaigorodov wrote:... create new method assignColor:
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Junilu Lacar wrote:I think that's a big improvement. I'd take the refactoring further. MetricScorer base class or interface with score() method that returns SUCCESS, FAILED, IMPROVED, or OPEN. Then two subclasses: first subclass scores SUCCESS when value is below the goal, the second subclass scores SUCCESS when value is above the goal. This way, you're calling the same score() method, and the way the score() method behaves is based on which subclass you're actually calling. This is more OO, IMO.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Jk Robbins wrote:I removed the test for the "open/white" option and I initialize it to "OPEN" just to give it a default value in case any of the other values aren't present.
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|