Quick thought about XML vs annotations for Spring wiring

Cantor, Scott cantor.2 at osu.edu
Mon Sep 21 11:23:58 EDT 2015


On 9/21/15, 11:12 AM, "dev on behalf of Tom Zeller" <dev-bounces at shibboleth.net on behalf of tzeller at dragonacea.biz> wrote:

>On the last dev call, we talked about whether we preferred XML (i.e. a Servlet) or annotations (i.e. a @Controller).

I don't think XML implies a servlet. It just implies a separation of the code from the declaration, which I prefer, but that's a personal view. I would (as the author of an extension) always favor explicitly configuring a mapping of paths to methods over annotations any day because one is hardcoded and one is configurable, and hardcoded paths are always a problem eventually.

I don't really like the current web flow situation in fact, for that reason, and after I started looking at how it plugs into webflow, I realized I wish we had just plugged in our own HandlerMapping class because that would have skipped over all the lousy SWF code and just implemented it ourselves. I still might, because we can't avoid the need to be able to configure the endpoints forever.

> I think that’s an interesting question, and over the weekend I had the thought that the project should not have much of an opinion as long as the configuration is externalized. And by externalized, I mean existing in the filesystem whose root is ${idp.home}. So, for example, if some profile is implemented by a @Controller which is enabled/activated via a property defined as part of a <component-scan /> element, that’s fine.

I'm not taking a position on it so long as there's no bleed-over. I didn't know the scanning was package-specific.

-- Scott



More information about the dev mailing list