Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: "Program to an interface" - When to break a design pattern Date: Tue, 10 May 2011 07:36:34 -0700 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: <9dt5s6dalhetgfe99qs92c02hf0dbas44e@4ax.com> <2psjssq4zj.fsf@shell.xmission.com> <2poc3gq3p2.fsf@shell.xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 10 May 2011 14:36:38 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="FaSG3tOezrXhBMTb3srAdg"; logging-data="4121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ulfCUL5Ji3M+Oe/QZOvr2E4VaTmhoVww=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:lnaTcWIaLq6gepgVcUpoXUJS4JI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3914 On 5/8/2011 10:48 AM, Daniele Futtorovic wrote: > This is perhaps the sixth time I've written the same thing with a > different wording. If it still doesn't get through to anyone, then yes, > I'll declare pearls before swine. Sorry for not being 'diplomatic' more > than the first half a dozen tries. No, I think you're right, if I've been following the discussion properly (it's gone a bit long winded). As an example, here's a method in the Java API that returns an array -- something with NO constraints on data order -- and yet the docs for the method say the order is guaranteed. It's even a relatively recently added method too, not some historical oddity. So I agree it's legit to document, but not enforce by type, ordering or other invariants on the objects a method returns.