[e-lang] Prize and Milestone as mutable state idioms
Monty Zukowski
monty at codetransform.com
Wed Jul 2 11:12:57 CDT 2008
On Tue, Jul 1, 2008 at 1:43 PM, Tyler Close <tyler.close at gmail.com> wrote:
> The ValueWriter provides an
> API for generating all the different kinds of JSON values and the
> client gets to choose which one to use, but it can only choose one!
> The Prize class is used to ensure that once the client starts creating
> a particular kind of JSON value, it sticks to that decision
That description above is what I was missing, that concept of only
choosing one JSON Value. It may be my lack of knowledge about JSON
prevented me from seeing that as obvious.
> So it looks like you understood the concept of a Prize, and eventually
> understood why the output stream was being treated as one. Is that
> right? How could this be made clearer? A comment at the Prize
> construction site?
What would've been even more helpful would be a javadoc comment for
ValueWriter that explained the basic usage--create ValueWriter, call
one and only one output method, NPE thrown if that is violated.
Monty
More information about the e-lang
mailing list