comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Design of cross referring types/classes and proper usage of containers
Date: Tue, 4 Aug 2015 15:27:42 -0500
Date: 2015-08-04T15:27:42-05:00	[thread overview]
Message-ID: <mpr78c$p9k$1@loke.gir.dk> (raw)
In-Reply-To: 3341271b-4926-40cb-a9aa-660522d56f24@googlegroups.com

"Serge Robyns" <serge.robyns@gmail.com> 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.


  parent reply	other threads:[~2015-08-04 20:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 16:08 Design of cross referring types/classes and proper usage of containers Serge Robyns
2015-08-03 16:14 ` Serge Robyns
2015-08-03 20:17   ` Georg Bauhaus
2015-08-03 16:22 ` Dmitry A. Kazakov
2015-08-04 11:43   ` Serge Robyns
2015-08-04 12:13     ` Dmitry A. Kazakov
2015-08-04 19:00       ` Serge Robyns
2015-08-04 19:20         ` Jeffrey R. Carter
2015-08-04 20:27         ` Randy Brukardt [this message]
2015-08-04 21:21         ` Simon Wright
2015-08-08 11:25           ` Serge Robyns
2015-08-09  3:11             ` Randy Brukardt
2015-08-09 13:33               ` Serge Robyns
2015-08-05  7:37         ` Dmitry A. Kazakov
2015-08-05 17:51           ` Serge Robyns
2015-08-05 19:21             ` Dmitry A. Kazakov
2015-08-06  7:00               ` Georg Bauhaus
replies disabled

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