Quick thought about XML vs annotations for Spring wiring
Misagh Moayyed
mmoayyed at unicon.net
Thu Sep 24 10:34:30 EDT 2015
> Yes, but you can't touch that file as a deployer. So that's not a good
> solution. I realize now that that's what Misagh was mentioning, we need
an
> include there to let people insert beans into it, but it's still not a
> good way to go.
>
> -- Scott
Yes, exactly. Thanks for bring this up. If you are just extending the IdP
platform, there needs to be a way to insert beans into the context without
actually touching system files. Otherwise, upgrades would become very
painful. Given the current IdP config architecture, I'd be inclined to
simply include a template XML config file that is totally empty, into the
context which is then decorated with all the right spring namespaces.
Then, the IdP would load this file in such a way that beans get inserted
into the context as the last step, which has the additional advantage of
overriding other bean configuration spread in various other files.
Overlay-style, as it were.
A side effect of this is that if the idp installer means to upgrade a
deployment automatically in the future, things might get out of hand with
user-overridden config. I'd nonetheless be interested to explore
possibilities to automate the entire bean configuration as much as
possible and remove XML config where allowed. Whether that is via
annotations or something else...
Misagh
More information about the dev
mailing list