Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7440
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Style Police (a rant) |
| Date | 2011-08-28 13:09 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <a0baf2ce-e796-4234-bd5f-517371f8d292@glegroupsg2000goo.googlegroups.com> (permalink) |
| References | (9 earlier) <j3bmum$hoa$1@news.albasani.net> <78817664-363f-4e73-99e5-ef3c0a3566af@glegroupsg2000goo.googlegroups.com> <j3c0dp$3jm$1@news.albasani.net> <f7ddd7ef-dde6-4b5f-97e4-6b00f04c12a1@glegroupsg2000goo.googlegroups.com> <j3dg1l$i8e$1@news.albasani.net> |
On Sunday, August 28, 2011 6:32:37 AM UTC-7, Jan Burse wrote: > Lew schrieb: > > Given that calling non-final methods from a constructor is a > > very well-known antipattern, it's a bit like asking, ... > > I didn't know that this is an anti pattern. A solution > could be also to make the method private. A well known antipattern, and private methods are inherently final. (So are static methods.) http://www.javapractices.com/topic/TopicAction.do?Id=215 Even more cautions about constructor, such as not to start a thread within one or let 'this' escape: http://www.javapractices.com/topic/TopicAction.do?Id=11 and on overridable methods: http://www.javapractices.com/topic/TopicAction.do?Id=89 More on overridable methods from constructors: <https://www.securecoding.cert.org/confluence/display/java/MET05-J.+Ensure+that+constructors+do+not+call+overridable+methods> <http://www.oracle.com/technetwork/java/seccodeguide-139067.html> in particular <http://www.oracle.com/technetwork/java/seccodeguide-139067.html#4-0> _et seq._ More on "practice safe construction" <http://www.ibm.com/developerworks/java/library/j-jtp0618/index.html> and the general antipattern of putting code in a constructor at all: <http://www.beaconhill.com/solutions/kb/java/code-in-constructor-anti-pattern.html> From this last link, a warning against using ignorance as an excuse: "When I asked why they were doing this they stated that they did it all the time. Then I explained how this is typically a good habit to have they defended themselves with 'Nobody told me'." -- Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Style Police (a rant) Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-26 20:56 -0400
Re: Style Police (a rant) Robert Klemme <shortcutter@googlemail.com> - 2011-08-27 09:58 +0200
Re: Style Police (a rant) Rajiv Gupta <rajiv@invalid.com> - 2011-08-27 18:02 +1000
Re: Style Police (a rant) v_borchert@despammed.com (Volker Borchert) - 2011-08-27 08:40 +0000
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 13:27 +0200
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 13:33 +0200
Re: Style Police (a rant) Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-27 11:08 -0400
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 08:34 -0700
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 08:37 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 17:59 +0200
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 18:06 +0200
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 18:08 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 09:50 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 19:15 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 13:09 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-27 23:18 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 16:10 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-28 01:59 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 18:59 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-28 15:32 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-28 13:09 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-29 04:02 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-28 19:20 -0700
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-29 09:44 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-29 08:30 -0700
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-08-29 16:37 +0000
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-29 12:10 -0700
Re: Style Police (a rant) Robert Klemme <shortcutter@googlemail.com> - 2011-08-29 18:21 +0200
Re: Style Police (a rant) Jan Burse <janburse@fastmail.fm> - 2011-08-29 04:06 +0200
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-10 06:45 +0200
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-10 11:40 +0000
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-10 14:06 -0700
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 14:07 +0000
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 10:55 -0400
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 23:34 +0000
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 10:58 -0400
Re: Style Police (a rant) Patricia Shanahan <pats@acm.org> - 2011-09-11 10:12 -0700
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-11 09:47 -0700
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 23:32 +0000
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-11 21:20 +0200
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-11 17:11 -0400
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-12 01:22 +0200
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 21:13 -0400
Re: Style Police (a rant) Retahiv Oopsiscame <roopsisc@gmail.com> - 2011-09-11 16:54 -0700
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-11 23:42 -0400
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 04:56 -0400
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-12 05:12 -0400
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 04:59 -0400
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-12 05:13 -0400
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 23:17 +0000
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 21:12 -0400
Re: Style Police (a rant) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-09-12 07:36 -0300
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 04:58 -0400
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-12 05:12 -0400
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-11 15:33 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-11 09:42 -0700
Re: Style Police (a rant) Lars Enderin <lars.enderin@telia.com> - 2011-09-11 20:35 +0200
Re: Style Police (a rant) Retahiv Oopsiscame <roopsisc@gmail.com> - 2011-09-11 16:55 -0700
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-11 20:36 -0700
Re: Style Police (a rant) Lars Enderin <lars.enderin@telia.com> - 2011-09-12 10:05 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-12 15:35 -0700
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 04:52 -0400
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-12 05:14 -0400
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 06:42 -0400
Re: Style Police (a rant) Cthun <cthun_117@qmail.net.au> - 2011-09-12 07:20 -0400
Re: Style Police (a rant) "Cthun" <cthun_117@qmail.net.au> - 2011-09-12 08:46 -0400
Re: Style Police (a rant) Tom Anderson <twic@urchin.earth.li> - 2011-09-12 20:18 +0100
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-11 21:20 +0200
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-09-11 13:52 -0700
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-12 00:17 +0000
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-10 21:32 -0400
Re: Style Police (a rant) Wanja Gayk <brixomatic@yahoo.com> - 2011-09-11 13:27 +0200
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 11:05 -0400
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 13:23 +0000
Re: Style Police (a rant) Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-11 10:04 -0400
Re: Style Police (a rant) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-09-11 12:45 -0300
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 16:53 -0400
Re: Style Police (a rant) Arne Vajhøj <arne@vajhoej.dk> - 2011-09-11 10:59 -0400
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-11 21:25 +0000
Re: Style Police (a rant) Tom Anderson <twic@urchin.earth.li> - 2011-08-27 14:00 +0100
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-27 08:42 -0700
Re: Style Police (a rant) Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-27 11:58 -0400
Re: Style Police (a rant) "John B. Matthews" <nospam@nospam.invalid> - 2011-08-28 08:21 -0400
Re: Style Police (a rant) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-08-28 18:07 -0300
Re: Style Police (a rant) Roedy Green <see_website@mindprod.com.invalid> - 2011-08-29 04:20 -0700
Re: Style Police (a rant) Tim Slattery <Slattery_T@bls.gov> - 2011-08-29 09:11 -0400
Re: Style Police (a rant) Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-29 20:50 -0400
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-08-30 11:27 +0000
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-30 09:36 -0700
Re: Style Police (a rant) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-08-30 17:51 +0000
Re: Style Police (a rant) Tim Slattery <Slattery_T@bls.gov> - 2011-08-30 08:51 -0400
Re: Style Police (a rant) Patricia Shanahan <pats@acm.org> - 2011-08-30 09:04 -0700
Re: Style Police (a rant) Lew <lewbloch@gmail.com> - 2011-08-30 09:43 -0700
Re: Style Police (a rant) Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-08-31 00:31 +0200
csiph-web