R4481 Checkstyle Parameter Rename Issue
Brent Putman
putmanb at georgetown.edu
Wed Sep 7 16:34:56 EDT 2016
On 9/7/16 8:34 AM, Cantor, Scott wrote:
>
> I think the real problem is that we need to stop using constructor
> arguments so much.
>
>
> I don't have a good rule of thumb here, we know it's a problem. I think
> the only real takeaways are:
>
> - c'tor arguments are bad
>
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 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.
If the latter: I totally agree. I can't remember whether I ever
actually noted that issue on the list or calls. (I certainly did in my
head.) If not, I definitely meant to when I first started noticing
it. I understand it makes the wiring easier to read and understand.
But as we saw here, it ties us to the actual arg name, which is a bit
unusual. That's not really in general an expected part of any class's
contract. But we're already doing it all over, so I guess that's more
of a long-term discussion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160907/a5827679/attachment.html>
More information about the dev
mailing list