02-Apr-2013 15:35, Andrei Alexandrescu пишет:
On 4/2/13 7:24 AM, Dmitry Olshansky wrote:
You might want to add Visitor pattern to Exceptions but it's darn messy
to deal with and is an overkill most of the time.

Actually I think that's a good thing to do.


Why would be that? It doesn't solve the key problem of "try clause plus a ton of semi-identical catches" used just to perform a mapping of X handlers to Y subsets of errors. Plus visitor does the same dispatch that is already addressed by exception handlers (or partly so).

If somebody comes up with a reasonable Visitor pattern for Exceptions that is flexible and fast then sure let's see it. I just doubt it'll help anything on its own in any case.

--
Dmitry Olshansky

Reply via email to