In fairness, it was actually the XML configuration that broke it (although it happened to be the XML configuration that specified allowing annotation-drive config). I'm not sure that the problem is really with where the configuration is, whether it is in an xml or a class annotation, the problem is that every module needs to be aware of what all other modules are doing so that they don't step on each other's toes. It is just a problem inherent to IoC that misbehaving modules can bring down the whole thing, particularly when there aren't enough controls in place. In this case, the whole Spring config door is wide open for a bad module author to abuse.

In my case, I didn't realize that I was sharing the same spring mvc configuration as all the other geoserver modules, and I also didn't realize the entire effect of the spring config directive(s) that I was using. Then it was all compounded by my erroneous commit to include the module by default.

I think the problem of every module needing to be aware of what all other modules are doing is improved somewhat by using a single XML config for module over annotations spread throughout the code because it is fewer places for other module authors to look. However, I think an even better solution is to reduce the need to be aware of what other modules are doing at all, with better encapsulation of each modules functions, and better documentation about what we do need to know about other modules. In this case it would be handy to know that that geoserver-rest module was basically replacing the entire spring MVC configuration system with its own mechanisms. Maybe a list somewhere in the geoserver docs of all extension points? Maybe I can contribute something to the docs about this, I see there is a placeholder there now.

Chris

On 5/6/2019 9:24 AM, Andrea Aime wrote:
Also, a bit of a rant if I can, these approaches based on annotations look nice when coding them, but one never knows where the side effects end up, while with XML hand wiring we get better control (see also the mapml module breaking REST completely). I guess we should try to discourage using annotations in a project as large and complex as GeoServer?

Cheers
Andrea




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

Reply via email to