yc,

While scanning the list of inputs for "ERR" is not something you would
necessarily build into a production application, it does provide an example
of how you would throw an exception within a RPC. Note the comment right
above the code snippet:

"For the sake of this example, keep it simple and only throw the exception
when the stock symbol ERR is added to the watch list."

Often times in these tutorials, we aren't out to build the perfect app,
instead we focus on providing guidance on the fundamentals of the toolkit
itself. How you work them into your app is going to be specific to the app
that you are building.

Thanks for the suggestion, please keep them coming.

- Chris

On Mon, Jan 4, 2010 at 6:34 PM, yc <ycx4...@gmail.com> wrote:

> Hello,
>
> I noticed a possible design bug in the "Handling Exceptions" section
> in the StockWatcher tutorial:
> http://code.google.com/webtoolkit/doc/latest/tutorial/RPC.html#exceptions
>
> If you enter "ERR" to add the delisted symbol, the app will no longer
> display stock quote on new valid symbols added after ERR.  You need to
> remove the ERR symbol from the stock table before adding new valid
> symbols.
>
> The root cause of this problem is how the program reads symbols after
> the ADD button is clicked.  In the StockWatcher.addStock() method, the
> "stocks" ArrayList is appended with a stock symbol regardless if the
> symbol is validated by the server.  The entire array of the "stocks"
> is passed to the server for validation in the
> StockWatcher.refreshWatchList() method.   But the
> stockPriceServiceImpl.getPrices() is designed to throw exception as
> soon as it sees the "ERR" string in the passed-in array.
>
> Correcting this design bug will make an already-excellent tutorial
> even better.  I hope some Googlers take note of this.
>
> Thx,
> yc
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to