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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.albasani.net!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Design of cross referring types/classes and proper usage of containers Date: Tue, 4 Aug 2015 15:27:42 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <12wxvkghwgpw3.k4qf1rqnppjb$.dlg@40tude.net> <8b424e66-337a-4943-91d1-e421312b5c95@googlegroups.com> <186o8cox1jqwa.yahqsx8p0k84$.dlg@40tude.net> <3341271b-4926-40cb-a9aa-660522d56f24@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438720077 25908 24.196.82.226 (4 Aug 2015 20:27:57 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 4 Aug 2015 20:27:57 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:27356 Date: 2015-08-04T15:27:42-05:00 List-Id: "Serge Robyns" wrote in message news:3341271b-4926-40cb-a9aa-660522d56f24@googlegroups.com... >And I've a final question based on the advise. > >Given static (immutable data) one one hand and dynamic data (changed during >the > execution) on the other hand; stored in various containers. What is > actually the > best approach? Shall I Storing the full element of objects or references > created > through new T_xyz? It obviously depends. Surely the first choice is to put the data objects directly into the container. That lets the container do all of the storage management (especially nice for indefinite types like T'Class); it's far more likely to do it correctly than you would. (the chances of a bug in your memory management code is much higher than the chances of a bug in a container implementation). I'd only put access types into a container if those access types exist for some other reason in your program. >If I want to use an access variables in the first method, do I need to pass >an aliased type? ??? Ada doesn't have aliased types ("aliased" is a property of an object [inc. components and parameters]). Randy.