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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,9e7db243dfa070d7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Do people who use Ada also use ocaml or F#? Date: Sun, 31 Oct 2010 16:32:57 +0100 Organization: Ada @ Home Message-ID: References: <1mjd3udlxgzp3$.1abzmwnslu9ym$.dlg@40tude.net> <1e1y89ly171$.91bu2wu1e2rk$.dlg@40tude.net> NNTP-Posting-Host: gHYtk+mhCrTAX6LNXybaBQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news1.google.com comp.lang.ada:15049 Date: 2010-10-31T16:32:57+01:00 List-Id: Le Sun, 31 Oct 2010 16:07:10 +0100, Dmitry A. Kazakov = a =C3=A9crit: >> You can build new components that use other components, hence you can= >> call it aggregation, but this is hidden in the body, so nobody cares,= >> it's not visible; unlike inheritance where the whole dependency has t= o >> be visible. > > But reusable components are visible as well, e.g. a list [component 1]= of > arrays [component 2] of something [component 3]. Yes, they are also visible, but the visibility you need to have is not t= he = same. Visibility here, does not really mean =E2=80=9Cwhat is visible=E2=80= =9D, instead it = means =E2=80=9Cwhat needs to viewed=E2=80=9D. With composition, you just need to see the interfaces and what is direct= ly = connected to these interfaces, i.e. what you need to view is what is mad= e = of an exploration of the direct environment. With Inheritance, the = exploration must be transitive, can go far and/or apply to many types, = i.e. there is no real local circumscription of consequences, as what is = at = one place, may be visible from all the places where the inheritance grap= h = can lead you from the original places (that is the meaning of =E2=80=9Cv= isible=E2=80=9D = here). This can be powerful, as much as it can damage the whole system. To talk using a picture : there are the kind of messages/mails/etc you = will see no objection to broadcast, and there is the kind of you would = avoid to. Something a bit similar applies (propagation). There are = sensible things which should not be propagated through an Inheritance = graph (which virtually has no limit), there are other for which you will= = not bother. To say Composition is the only good way to go, would be extremist; but y= ou = can safely say, using Composition, you will avoid many potential trouble= s. = The most secure you want to be with your design, the most you will use = Composition. And if the power of Inheritance is used, you will have to = carefully balance what you are throwing potentially far away (at least y= ou = may want to avoid for likely bombs, but you will not bother for fancy = stuffs). -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.