comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Constructing by classwide type
Date: Wed, 19 Apr 2017 15:45:55 -0500
Date: 2017-04-19T15:45:55-05:00	[thread overview]
Message-ID: <od8ia4$nej$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: od5qd0$10nc$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:od5qd0$10nc$1@gioia.aioe.org...
> On 2017-04-18 20:57, Randy Brukardt wrote:
>> "Alejandro R. Mosteo" <alejandro@mosteo.com> wrote in message
>> news:od5ins$drj$1@dont-email.me...
>> ...
>>> I've been under the same circumstances recently and wondered the same. I
>>> hope you get some informed answers. Until date, I have noticed no
>>> drawbacks and all the advantages you mention.
>>
>> I don't think there is AN answer. Unless you have to satisfy someone who 
>> is
>> worshipping a the church of OOP, the best design is the one that works 
>> for
>> your application, minimizes unnecessary coupling, and makes as many 
>> errors
>> as possible detectable at compile-time.
>
> Yes, but in some cases one can prove more or less formally that the design 
> might not work. So it is not always arbitrary.
>
> Regarding the question it seems overloading vs. overriding / factory vs. 
> constructing functions, not really exactly same use case.

Which was really my point: the design should get organized according to the 
use, not according to some religion which is then bent to the use. In my 
experience, the factory constructor use case doesn't come up much - most of 
the time you know what object you need (and want to create it statically).

                                        Randy.



      reply	other threads:[~2017-04-19 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  1:04 Constructing by classwide type sbelmont700
2017-04-18 17:37 ` Alejandro R. Mosteo
2017-04-18 18:57   ` Randy Brukardt
2017-04-18 19:45     ` Dmitry A. Kazakov
2017-04-19 20:45       ` Randy Brukardt [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox