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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,58f5085c2edafcfe X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!postnews.google.com!v3g2000hsg.googlegroups.com!not-for-mail From: kevin cline Newsgroups: comp.lang.ada Subject: Re: Design - cyclic dependencies Date: Wed, 31 Oct 2007 22:16:43 -0000 Organization: http://groups.google.com Message-ID: <1193869003.239741.196820@v3g2000hsg.googlegroups.com> References: <1193401560.389194.282030@o3g2000hsb.googlegroups.com> NNTP-Posting-Host: 167.107.191.217 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1193869003 26882 127.0.0.1 (31 Oct 2007 22:16:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 31 Oct 2007 22:16:43 +0000 (UTC) In-Reply-To: <1193401560.389194.282030@o3g2000hsb.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v3g2000hsg.googlegroups.com; posting-host=167.107.191.217; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2687 Date: 2007-10-31T22:16:43+00:00 List-Id: On Oct 26, 7:26 am, Maciej Sobczak wrote: > Consider: > > -- a.ads: > package A is > type T is new Integer; > procedure P; > end A; > > -- a.adb: > with B; > package body A is > procedure P is > X : T; > begin > B.P (X); > end P; > end A; > > -- b.ads: > with A; > package B is > procedure P (X : A.T); > end B; > > -- b.adb: > package body B is > procedure P (X : A.T) is > begin > null; > end P; > end B; > > There are two logical modules A and B, implemented as packages. > There is no cyclic dependency between the specifications of these > packages and the code is legal. > Still, there is a design-level cyclic dependency between the whole > modules in the sense that A depends on B (A calls some operation of B) > and that B depends on A (B uses some type from A). > > Being legal does not imply being good and therefore I ask: do you > consider this kind of design-level cyclic dependency to be acceptable? I have no idea what you mean by 'logical module' or 'design-level cyclic dependency'. But circular package dependencies are never acceptable to me. I would either combine A and B into a single package, or else break the circularity by moving T into B.