Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 18 May 2012 16:36:13 -0500 Date: Fri, 18 May 2012 14:35:57 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: How is this "pattern" called? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 36 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.202.8 X-Trace: sv3-QpUY86K7LmUu/2abWrwzoZ0bdb5lV1tSeob3Jj0oAcbB3rBm/d7pZhLfzpftFp+zE30gYnkEdr/EnqM!APpM+wCL2HJDAtJBPs8E9iRKzJ220xu1zBpFfjL894ii4/+bGgA4Er2P1bltImcG2TStO2F+JNEP!gWGs6nkmX0xoIyszgAjz1sWRHODgHhONtej8WTWKbJnC X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2801 X-Received-Bytes: 2994 Xref: csiph.com comp.lang.java.programmer:14632 On 5/18/2012 2:13 PM, Gene Wirchenko wrote: > On Fri, 18 May 2012 12:20:11 -0700, markspace<-@.> wrote: > >> On 5/18/2012 10:50 AM, Gene Wirchenko wrote: >> >>> a case of KISS or maybe YAGNI. > >> I like these too; good thoughts. > > 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! Some people seem to think that the last thing you should is do > in OOP is write a statement that actually instantiates an object. > (Qual horreur!) Instead, you call a factory -- is that it? -- and > have all sorts of indirection. > > If you *really* need that, fine, but I do not. The closest that > I have come to this is related classes needing common code. I have > them inherit from a class with that code. That code class is never > instantiated itself. > > With all of the hoopla over OOP patterns, it is difficult for me > to tell how much they are really needed. > > Yes, I go for keeping it fairly simple. I think a lot depends on the answer to one key question: What is the cost if this needs to be changed? If we are talking about a widely distributed API, where a change will break thousands of programs, it is worth doing a lot to minimize the risk of incompatible change. If we are talking about code that is used in a couple of places in one program, KISS and refactor if necessary. Patricia