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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b7d18bb54ce3f52,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.82.2 with SMTP id e2mr1494756pay.40.1344278523774; Mon, 06 Aug 2012 11:42:03 -0700 (PDT) Path: c10ni90351pbw.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: ms Newsgroups: comp.lang.ada Subject: Interface to aggregated type Date: Mon, 6 Aug 2012 11:42:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8e844311-f470-4382-8acc-ffe30aee1c18@googlegroups.com> NNTP-Posting-Host: 85.222.97.27 Mime-Version: 1.0 X-Trace: posting.google.com 1344278523 10863 127.0.0.1 (6 Aug 2012 18:42:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 6 Aug 2012 18:42:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.222.97.27; posting-account=Qm6IFAoAAADLRMuMbYtLLXPPuIEGRdpu User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-06T11:42:03-07:00 List-Id: My question is half-ada/half-architectural, I'll explain it on simple HTTP = server example. Imagine HTTP library providing two packages - `Headers` which provides cont= ainer for HTTP headers (`Header_Container` type) and `Requests` which is a = abstraction over HTTP request message (`Request` type). Clearly `Request` aggregates `Header_Container`, as HTTP requests generally= contain some set of headers. My dilemma is - `Headers` package already provides some sort of `Header_Con= tainer` manipulation interface - procedures for inserting and deleting head= ers and functions to return them, but I want allow these operations also on= container aggregated inside `Request` type (which is probably a private re= cord). Now I have several options such as duplicating header manipulation interfac= es entirely (eg. function Header_Value (R : Request, Name : String) in `Req= uests` package) or making aggregated `Header_Container` field public (can I= make only some of the record's fields public and leave others private?). B= oth have pros and cons, and possibly even more solutions exist. What would you do?