Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: How is this "pattern" called? Date: Sat, 02 Jun 2012 09:25:10 -0700 Organization: albasani.net Lines: 52 Message-ID: References: <54jdr7164mceis033e8f7amqb3qhjdfv9r@4ax.com> <4fb8590f$0$295$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net 0UwLV/U2U7/qNM2xHXUukzLakOtftYXpYXRtHlPvupRB1sgLIc0BXbHy83sI5p64LoonibL6WlM/dqlzrKGxBUS887d8l8W92oojUqdIKAMrk0kpwj1/LxvKBPuHTXf5 NNTP-Posting-Date: Sat, 2 Jun 2012 16:24:59 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="0H3Mt7dHq9/0uKlb1GwP47rCWwRTW6r381hBPEPbWlA2SvOwzkPPe8FN2EwA2/pzm8lItfCdc5F765Muofo5S59cF1afbSQ19WCfSN3g+h6SxbTOwJlMBqUnoDRz+8pC"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: Cancel-Lock: sha1:Jq75CoBkC/MKpyrXLVHm5dg6U3U= Xref: csiph.com comp.lang.java.programmer:15004 Wanja Gayk wrote: > noone@lewscanon.com says... >> Arne Vajhøj wrote: >>> Gene Wirchenko wrote: >>>> With the amount of noise over patterns though, you would think >>>> that many people need the patterns. For me, supporting an in-house >>>> application, there is no or little need. >>> >>> Or you have not realized the need. >> >> Or both of you are looking at it from the wrong perspective. >> > [..] >> The argument is over "patterns" in the GoF sense, a highly bureaucratized, >> overly-verbose and religiously canonical set of labels and formats to describe >> them. But even amidst all the sturm und drang over the latter kind of >> patterns, they provide value in a common terminology and informal use. So when >> we discuss Visitor or Singleton, we all know what we mean. ("We" being >> competent programmers. One occasionally sees posters here who are less >> knowledgeable.) > > I guess that's one of the most common misconceptions. Some people seem > to think that patterns are used, because they are considered cool and > fancy. While in the real world you use any certain pattern because and > only when it solves your problem. > > I have seldomly seen a visitor pattern in the wild, because there are > not so many occasions where it's so considerably better than something > that is easier to understand to make it worth using. > But the strategy pattern is used everywhere, everytime you use a > Comparator for example, simply because it solves a very common problem > very well. Someone who has actually read up on patterns will find that every pattern document includes the motivation or scenarios for which the pattern applies. No pattern is claimed to be universally applicable, or offered as "cool", but always as relevant for a particular type of situation. Part of knowing about patterns is learning to discern when one is useful and when it isn't. Any competent programmer who claims not to use patterns is lying, or at best being disingenuous. One might not use them literally in the GoF style, but they are there. As others in this thread have pointed out, if you program for Swing or use almost anything in the standard API, you're using patterns even if only those imposed on you by the API writer (e.g., MVC). Patterns in the general sense are at the heart of effective programming. (Patterns in the formal, strictly GoF-imitative sense not so much.) -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg