Quick thought about XML vs annotations for Spring wiring

Cantor, Scott cantor.2 at osu.edu
Thu Sep 24 14:04:00 EDT 2015


On 9/24/15, 1:40 PM, "dev on behalf of Brent Putman" <dev-bounces at shibboleth.net on behalf of putmanb at georgetown.edu> wrote:
>
>Ok, but I assume you mean "override" beans from a higher context in a lower context.

No, same.

>Since IIRC Spring enforces ID uniqueness at the XML level (at least I think the bean ID is an XML ID type).  Although I guess there's also 'name' aliases - don't know what it does with duplicates names there...

Aliases get around that, but so does using separate files. The XML ID thing is optional and only works within a single file. With included XML files they can collide and people view it as a feature. I think it's a risky thing to take advantage of, and would argue it's better to templatize the actual name of the bean being injected and just override that.

>I guess I haven't looked but I thought we had a user-space config way for users to add stuff to web.xml that carries across upgrades.  Maybe I'm misremembering.  Or we talked about but didn't implement?

We have a way to edit it and get it used in place of the delivered file, but that's it. If we *have* to change it, that makes upgrades troublesome, so editing it is not a step to take lightly as a deployer.

I realize that there are web.xml overlays now, but we didn't try those. They're relatively new.

-- Scott



More information about the dev mailing list