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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.70.91.204 with SMTP id cg12mr2743269pdb.7.1438688605909; Tue, 04 Aug 2015 04:43:25 -0700 (PDT) X-Received: by 10.140.91.110 with SMTP id y101mr29458qgd.39.1438688605864; Tue, 04 Aug 2015 04:43:25 -0700 (PDT) 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.glorb.com!pg9no6912417igb.0!news-out.google.com!78ni5929qge.1!nntp.google.com!69no3804625qgl.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 4 Aug 2015 04:43:25 -0700 (PDT) In-Reply-To: <12wxvkghwgpw3.k4qf1rqnppjb$.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.107.233.114; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 94.107.233.114 References: <12wxvkghwgpw3.k4qf1rqnppjb$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8b424e66-337a-4943-91d1-e421312b5c95@googlegroups.com> Subject: Re: Design of cross referring types/classes and proper usage of containers From: Serge Robyns Injection-Date: Tue, 04 Aug 2015 11:43:25 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:27351 Date: 2015-08-04T04:43:25-07:00 List-Id: On Monday, 3 August 2015 18:22:20 UTC+2, Dmitry A. Kazakov wrote: > > When aggregation does not work, which is the case when relationships are > complex, you keep them outside. You create maps > > Client to [not null access] Subscription > Subscription to [not null access] Client > > etc. And search the maps if you have one and need another. For the map you > can use hash or binary searched container. > > Note that aggregation is fragile. If you have a suspicion that > relationships may go chaotic, don't aggregate. > > -- Thank you for the advice. You confirm my intuition, which also makes the implementation more in 1 to 1 with the storage data model, as the db will be used for other purposes as reporting. Today, I'm indeed using map containers for most of these. Is there any point of attention when using access variables to containers? Any risk of dangling pointers because of operations on the elements of the map (updates)? Regards, Serge