R4481 Checkstyle Parameter Rename Issue

Cantor, Scott cantor.2 at osu.edu
Wed Sep 7 16:43:43 EDT 2016


On 9/7/16, 4:34 PM, "dev on behalf of Brent Putman" <dev-bounces at shibboleth.net on behalf of putmanb at georgetown.edu> wrote:

> Do you mean the actual use of constructor arguments in code?  Or the use of ctor arg names
> in Spring wiring with the "c:" namespace (as opposed to indexes, or just using non-c
> namespace beans)?

I mean constructor arguments. They're inherently a problem when exposing Spring wiring to users, and good or bad, that's how this system was built. It was that or custom XML.

> I don't really at all agree with the former.   I think they're natural and even essential
> for args that are mandatory, esp when the class isn't Initializable or similar.  It's the
> best way to ensure that the class is instantiated in a known good state.  And
> often you don't want or need to expose a property with a public getter/setter.

I think the point of the Component interfaces was to get to a place where we could use properties safely. Maybe I'm reading into that, but given the problems with constructors in Spring wiring, that seemed like the point of it to me.

Sometimes it's unavoidable, but I think we could have used the component interfaces more than we did. I inherited a lot of code that didn't use them and also seems to have used constructors and I think that was probably a mistake to keep.

-- Scott




More information about the dev mailing list