R4481 Checkstyle Parameter Rename Issue
Brent Putman
putmanb at georgetown.edu
Wed Sep 7 17:23:30 EDT 2016
On 9/7/16 4:49 PM, Cantor, Scott wrote:
> On 9/7/16, 4:43 PM, "Cantor, Scott" <cantor.2 at osu.edu> wrote:
>
>> I mean constructor arguments.
> Incidentally I didn't think that was a controversial view, I thought the general view in Java was that beans should try and use properties and not non-default constructors.
Well, hmmm. Personally I've never really had that perception, as a
general design Java pattern. It's true that there is the concept of a
"bean", with those conventions. But I don't know if that's intended to
apply to everything, always. Sometimes the bean convention applies and
makes sense, and sometimes it doesn't. Re the latter: I think it's
telling that AFAIK Java Beans convention doesn't have any default or
built-in notion of init-ing a bean, to make it "ready", validate it's
state, etc. So it may be natural for things which don't have any
*required* properties. But I think it's less natural for those that do.
> Nothing's absolute, but that was my impression as to recommended practice, and why Spring has the init-method ook.
It's true that the Spring project definitely has, or at least had, that
position. IIRC way way back they originally didn't even support ctors
at all on wired beans, or at last poorly. But they started supporting
non-default ctors eventually as first-class citizens. So I'm not so
sure that's their philosophical position now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160907/74a25ee5/attachment.html>
More information about the dev
mailing list