Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: equals(), Sets, Maps, and degrees of equality Date: Fri, 11 Nov 2011 15:19:49 -0800 Organization: A noiseless patient Spider Lines: 30 Message-ID: References: <24123649.762.1320892382934.JavaMail.geo-discussion-forums@vbmh5> <4407931.1762.1321025241857.JavaMail.geo-discussion-forums@prep8> <4d65ddbc-fe11-47e5-bdb1-cefca729f8f5@p5g2000vbm.googlegroups.com> <16879805.1372.1321050142818.JavaMail.geo-discussion-forums@prew38> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 11 Nov 2011 23:19:51 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="22917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/08mHryZwdUFEKckoFUAmzXscj9K8GBDw=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <16879805.1372.1321050142818.JavaMail.geo-discussion-forums@prew38> Cancel-Lock: sha1:TOQBLebHx293LM3ICWlEZIleW/M= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9861 On 11/11/2011 2:22 PM, Lew wrote: > Because you want to use 'Dog' to model 'Breed', and they aren't the same thing at all. That's what I'm getting too form Andreas and Eric. Breeds are discreet things that ought to be first class objects in a design like this. Modeling them as just String seems sub-optimal. It's about as bad as modeling Zip codes as strings or ints. You can, sure, but why not apply a type to it? Zip codes have just enough structure and invariants that strings or ints are almost certainly too loosey-goosey. It's taken me a little bit to understand what they've been talking about because the original design was straight forward and simple, but the original design is probably wrong too for anything besides a throw away example. >>>> Sean Mitchell wrote: >>>>> I may want to have a Set, which holds only one Dog of each breed, >> On Nov 11, 10:27 am, Lew wrote: >>> This is terrible modeling. > On Friday, November 11, 2011 10:28:35 AM UTC-8, Sean Mitchell wrote: >> Really. Why? On 11/11/2011 2:22 PM, Lew wrote: > Because you want to use 'Dog' to model 'Breed', and they aren't the same thing at all.