Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14634
| From | markspace <-@.> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: How is this "pattern" called? |
| Date | 2012-05-18 15:28 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <jp6iei$m8u$1@dont-email.me> (permalink) |
| References | <pattern-20120518104439@ram.dialup.fu-berlin.de> <ydnlikpbhon.fsf@shell.xmission.com> <lp2dr7da6p0jslnua32ldd4uki1036ibfs@4ax.com> <jp67dc$fe8$1@dont-email.me> <rhedr7ti7idd7ratbaludl5m14jo60p04l@4ax.com> |
On 5/18/2012 2:13 PM, Gene Wirchenko wrote: > > I have tended to avoid using OOP patterns except for what I came > up with myself. I did try reading one of the OOP patterns books, but > ugh! > ... > If you *really* need that, fine, but I do not. To me, this is the key part here. If you actually get the Gang of Four book on patterns and read it -- and I mean read ALL of it, starting with the front inside cover -- it says in the *introduction* not to use the patterns exactly as presented, but to modify them to your particular requirements. Patterns are there for you to get ideas from, but they are not laws that must be followed with out deviation. You're still required to think when using any given pattern. In addition, with each pattern (that I've read, at least), the GOF include a list of pro's and con's, and sometimes the cons are quite surprising. For example the Visitor pattern doesn't work well when the nodes/tree to traverse under goes lots of changes. The reason is that the Visitor pattern isolates the implementation for each node, and it can be a pain to go back into each implementation and add code for each new type of node. They recommend not using the Visitor pattern at all in this circumstance. Just use polymorphism and add the visitor API to each node directly. *That* is the biggest advantage to patterns and their study, imo. NOT "rah rah yay patterns" but telling you when using a pattern might leave you up a creek with no paddle. It allows you to eliminate a broad swath of design space quickly and points you in a better direction.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: How is this "pattern" called? Jim Janney <jjanney@shell.xmission.com> - 2012-05-18 10:03 -0600
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-18 10:50 -0700
Re: How is this "pattern" called? markspace <-@.> - 2012-05-18 12:20 -0700
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-18 14:13 -0700
Re: How is this "pattern" called? Patricia Shanahan <pats@acm.org> - 2012-05-18 14:35 -0700
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-18 15:29 -0700
Re: How is this "pattern" called? Arne Vajhøj <arne@vajhoej.dk> - 2012-05-19 22:38 -0400
Re: How is this "pattern" called? Lew <noone@lewscanon.com> - 2012-05-20 11:34 -0700
Re: How is this "pattern" called? Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 14:59 -0400
Re: How is this "pattern" called? Patricia Shanahan <pats@acm.org> - 2012-05-20 12:03 -0700
Re: How is this "pattern" called? markspace <-@.> - 2012-05-20 13:19 -0700
Re: How is this "pattern" called? Wanja Gayk <brixomatic@yahoo.com> - 2012-05-30 14:32 +0200
Re: How is this "pattern" called? Lew <noone@lewscanon.com> - 2012-06-02 09:25 -0700
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-20 20:40 -0700
Re: How is this "pattern" called? Wanja Gayk <brixomatic@yahoo.com> - 2012-05-30 14:33 +0200
Re: How is this "pattern" called? Wanja Gayk <brixomatic@yahoo.com> - 2012-05-30 14:32 +0200
Re: How is this "pattern" called? markspace <-@.> - 2012-05-18 15:28 -0700
Re: How is this "pattern" called? Arne Vajhøj <arne@vajhoej.dk> - 2012-05-19 22:37 -0400
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-20 20:43 -0700
Re: How is this "pattern" called? Lew <noone@lewscanon.com> - 2012-05-21 00:09 -0700
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-21 10:04 -0700
Re: How is this "pattern" called? Wanja Gayk <brixomatic@yahoo.com> - 2012-05-30 23:58 +0200
Re: How is this "pattern" called? Arne Vajhøj <arne@vajhoej.dk> - 2012-05-19 22:33 -0400
Re: How is this "pattern" called? Gene Wirchenko <genew@ocis.net> - 2012-05-20 20:44 -0700
Re: How is this "pattern" called? Lew <noone@lewscanon.com> - 2012-05-21 00:11 -0700
csiph-web