Re: Prize and Milestone as mutable state idioms
"Monty Zukowski" <monty-aaXZSQuah4Ac3H1WRXY/HAC/[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 1, 2008 at 1:43 PM, Tyler Close <[email protected]> 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