From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Full view of a private partial view cannot be a subtype Date: Mon, 4 Dec 2017 19:04:26 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <889a3aed-4e6b-49c8-8c1c-6f1478e8e077@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 4 Dec 2017 18:04:26 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7a69b3c1b562598e493b87522700acec"; logging-data="21166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lVXPg+O8lw8iGrexOZlL/Khg/mD5JoKA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:BAQ4UixzNd95/yTSpb5kmtKLo8g= Xref: reader02.eternal-september.org comp.lang.ada:49358 Date: 2017-12-04T19:04:26+01:00 List-Id: On 12/03/2017 11:23 PM, Jere wrote: > > Well, I think either form is a bit too polar. I've always been taught that > you use the tool that makes the most sense given the context. If a type > has an "is a" relationship, you favor extension. But if it has a "has a" > relationship, you favor composition. If the situation is unique enough, > then you do something outside the norm. The most important thing is to create the simplest and clearest code possible. Tools must be judged by how well they help achieve this. Between type extension and composition, composition is almost always easier to read and understand. -- Jeff Carter "I would never want to belong to any club that would have someone like me for a member." Annie Hall 41