Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.glorb.com!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 07 May 2011 18:28:07 -0500 From: Zapanaz Newsgroups: comp.lang.java.programmer Subject: Re: "Program to an interface" - When to break a design pattern Date: Sat, 07 May 2011 16:28:40 -0700 Message-ID: References: <9dt5s6dalhetgfe99qs92c02hf0dbas44e@4ax.com> <2psjssq4zj.fsf@shell.xmission.com> <2poc3gq3p2.fsf@shell.xmission.com> X-Newsreader: Forte Agent 6.00/32.1186 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Lines: 31 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-8ri4rbHcOdc6rBSWU0NFc5xPQ6TmIxoI9bwZ8sc674qG/Vmc5ehttIcgyKp/qLMptbxkmxwNGsdOrbU!FYAltf4Gy3CocKkSfnARJErirBhPEKUjZwfgnEBzEUOJ6rpKDcww9SOF6g/c9vQufQvCexE= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html 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: 2445 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3772 On Fri, 06 May 2011 12:17:55 -0400, Lew wrote: >On 05/06/2011 08:01 AM, Jukka Lahtinen wrote: >> Lew writes: >>> Jim Janney wrote: >>>> The justification is not in the code shown, but in the accompanying >>>> remark "I need the map to retain the insertion order." There's no >>>> interface in the JRE that promises this, >> >>> other than >>> >>> you mean. >> >> But I'm looking at the SortedMap and LinkedHashMap javadocs, and it >> seems to me that LinkedHashMap doesn't implement the SortedMap >> interface. >> So, defining the return value as SortedMap you'd have to change the >> actual implementation class. > >Yes, noted multiple times so far. I was wrong. My method name was unfortunate. -- Zapanaz International Satanic Conspiracy Customer Support Specialist http://joecosby.com/ You know you're in Saskatchewan when you can sit on your front porch and watch your dog run away for three days :: Currently listening to Todesfuge, 2003, by Diamanda Galás, from "Defixiones, Will and Testament"