News for hackers. Stuff that matters.
Re:Replacing Throwing Exceptions with Notification in Valida... by mwhite on Saturday December 13, 2014 @06:57PM (#8746967)
Exactly. This article doesn't address the fact that for most programs you ideally want to have a separate UI validation where you're dynamically validating the user input before it gets submitted, and an internal validation where you validate the data before it gets saved, but also possibly even after it gets saved, relative to pre-existing data (where you could throw an exception and abort the transaction if it didn't validate).

If you want to use some of the same validation code for user input validation and internal validation, I suppose you could modify the notation pattern to conditionally throw an exception when adding a new error depending on whether it's on the client or the server.

Re:Replacing Throwing Exceptions with Notification in Valida... by dragonwriter on Saturday December 13, 2014 @07:24PM (#8747020)
> If you want to use some of the same validation code for user input validation and internal validation, I suppose you could modify the notation pattern to conditionally throw an exception when adding a new error depending on whether it's on the client or the server.

Or you reuse the validation code itself, but called from a wrapper that turns notifications into exceptions, rather than adding branches.