Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: no easy way to do a reverse pointer? Date: Fri, 7 Jul 2017 18:06:32 -0400 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <6c91c2b4-7d8f-42ba-8a51-eaef43635f49@googlegroups.com> <1d4174af-ff17-433c-bb32-23e17388e9ff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 7 Jul 2017 22:02:50 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="bb089af208211ccf62e97802cb88dc75"; logging-data="7846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NjNvz4qLk4tsjZFY72o9H" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: <1d4174af-ff17-433c-bb32-23e17388e9ff@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:yxsP+DAn6d6fUx7KhOeTeuEBnfI= Xref: csiph.com comp.lang.java.programmer:36833 On 7/7/2017 4:28 PM, Eric Douglas wrote: > [...] > > public class KitchenDuty { > } > > public class NightWatchDuty { > } > > public class Soldier { > } > > Now, the easiest way to set and get a soldier's duties? > Any one soldier may be assigned multiple duties. > Any duty may have multiple soldiers. > We need to be able to list which soldiers are on any given duty. > We need to be able to list which duties are assigned to any given soldier. Maybe a single central Set would suffice, where each Assignment associates one Soldier with one Duty. (It might also record the Officer who made the Assignment, so you can check whether some other Officer has sufficient rank to overrule it ...) -- esosman@comcast-dot-net.invalid Twelve hundred ninety-three days to go.