Jody Garnett ha scritto:
>> Works for me, but how do we deal with code that wants to throw a
>> safeguard exception in the last else? The usual "there is a programing
>> error, I don't know what this thing is" kind of exception.
> 
> I think that shows up as a null pointer exception; or a compile error

Compile error would be best, a NPE please no, it's the worst exception
a program can throw.

> - since the visitor pattern demands you strongly type all the options?
> You could also make a default adapter that calls a notHandled() method
> for each case by default.

Right... this does not seem to play very good in the resource/store
extensibility idea thought. But if we have the visitor work on
ResourceInfo generically we're back at square one, the if/else
that Justin wants to remove is back there... oh my.
On the bright side it's true that with a type specific method each
we get a compiler error (the new kind of resource would not know
what vistor method to call).

Good enough for me, having resource/store really extensible/pluggable
would probably require a ton of other extension points anyways.

Cheers
Andrea



-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to