Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: equals(), Sets, Maps, and degrees of equality Date: Sun, 13 Nov 2011 21:18:13 -0800 (PST) Organization: http://groups.google.com Lines: 26 Message-ID: <9303418.406.1321247893311.JavaMail.geo-discussion-forums@prgt40> 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> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1321247896 19949 127.0.0.1 (14 Nov 2011 05:18:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 Nov 2011 05:18:16 +0000 (UTC) In-Reply-To: <16879805.1372.1321050142818.JavaMail.geo-discussion-forums@prew38> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9946 Lew wrote: > Sean Mitchell wrote: >> Lew wrote: >>=20 >>>>> consider a class Dog: >>>>> public class Dog { >>>>> =A0 String breed; >>>>> =A0 String name; >>>>> =A0 String age; >>>>> } >>>>> I may want to have a Set, which holds only one Dog of each breed= , >>> >>> This is terrible modeling. >>=20 > > Really. Why? >=20 > Because you want to use 'Dog' to model 'Breed', and they aren't the same = thing at all. Also, "age" is not purely an attribute of 'Dog', but of 'Dog' plus "now". = It makes no sense to store an age that will be obsolete the instant it's st= ored. Rather, store the birthday. --=20 Lew