Style question : sort members ?
Cantor, Scott
cantor.2 at osu.edu
Thu Feb 13 18:54:44 EST 2014
On 2/13/14, 6:50 PM, "Tom Zeller" <tzeller at dragonacea.biz> wrote:
>
>Maybe take a look at n.s.i.service.ReloadableSpringService in
>idp-core, and suggest where the beanName field, setBeanName() and
>doInitialize() methods, which were added to implement BeanNameAware,
>should be moved to ? I just tacked the methods on at the end,
>semantically meaning "added last". I put the beanName field next to
>parentContext, because they are related to the *Aware interfaces. I
>guess doInitialize() should be moved above doDestroy and after
>doReload().
Just my personal style, but I've been consistently doing:
- Constructor
- Get/Set pairs for bean properties (but only providing set unless get is
really needed)
- doInit/doDestroy/etc.
- actual class methods
I like that order because doInit is normally checking the results of the
set methods, and it makes the code read in "execution order" to some
extent.
-- Scott
More information about the dev
mailing list