Encapsulation theory: the configuration efficiency limit
This paper shows how maximum possible configuration efficiency of an indefinitely large software system is constrained by chosing a fixed upper limit to the number of program units per subsystem. It is then shown how the configuration efficiency of a…
Authors: Edmund Kirwan
Encapsulation theor y: the configuration efficiency limit. Edmund Kirwan * www .EdmundKirwan.com Abstract This paper show s how maximum possible configur ation ef f iciency of an indefinitely lar g e sof tw are sys tem is constr ained by chos i ng a fixed upper limit to the number of pr ogr am units per subsys tem. It is then sho wn how t he conf igur ation ef ficiency of an indef init ely lar g e sof tw ar e syst em depends on the r atio of the to tal number of informaiton hiding violational softwar e units divided by the tot al number of pr og ram units. Ke ywords Encapsulation, potential s tructural com plexity , configuration eff iciency . 1 . Introduction The configuration ef ficiency of a softwar e sy stem was int roduced in [1] and defined as being that propor tion of potential s tr uctural comple xity (P .S.C.) that a sy stem e xpresses o v er and abo v e t he minimum possible P .S.C. of that sys tem. T w o ques tions in [1] concer ning the configuration ef ficiency , how e v er , remained unansw ered. The first relates to figure 24 in the ref erenced paper , reproduced here: F igure 2 4: Conf igur at ion eff iciency with t en pr ogr am units pe r subsy stem What is the precise relationship betw een the conf iguration efficiency and the cons traint of a fixed number of program units per subsy stem, as sho w in fi gure abo v e? The second ques tion relates to table 2 in the refer e nced paper , reproduced he re: * © Edmund Kirwan 2008. R e vision 1 .0, No v 1 6 st 2008. arXiv .org is gra nte d a non-e x clusive and irrev ocable license to distribute this ar ticle; all other entities may r epublish, but not f or profit, all or par t of this mater ial pro vided refer ence is made to the author and title of this pa per . The latest re vision of this paper is av a ilable at [2]. N um. nodes P .S.C. C.E. I.H.V . SEdit 1 35 1 6956 0.09 93% Fractality 240 1 9042 0.86 25% HSQLdb 283 6 1 633 0.3 7 7 2% Jasper Reports 3 1 6 99540 0 1 00% JBPM 366 1 33590 0 1 00% Manta- Ra y 384 1 32298 0. 12 89% Blue Mar ine 468 1 9499 1 0. 1 3 89% Jboss 4244 1 7 6 1 9836 0.02 98% Eclipse 39 1 1 4 9339 1 6300 0.4 6 1% T able 2: Sample sys tems and associated metrics Wh y , in table 2, is there a cor relation betw een the conf iguration efficiency (C.E.) and t he ratio of the number of public program units divided by the to t al number of program units (the I.H.V ., e xpressed as a percentag e)? (Recall that the public a cces sor in Ja va – in which a ll the sy stems abo ve w ere written – is t he means of implementing the more g eneral notion of inf or mation hiding violation.) This paper answ ers both of the se q uestions. No te t hat this paper co v e rs onl y the non-hierar chical encapsulation conte xt. 2. Fix ed-sized subsys tems As softwar e sy stems gro w , t he number of program units per subsy stem must also gro w if the sy stem's P .S.C. is t o be m inimised and the configuration eff iciency maximised. F or e xample, a sy stem of 1 0,000 program units, with one inf or mation hiding violation per subsy stem, w ould requir e one hundred program units in each subsy stem. Modern sof tw are practices, ho we v er , tend to res tr ict the number of program units per subsys tem to a figure much lo w er t han 1 00. No figure is univ ersally agreed upon, but subsy stems typicall y cont ain f ew er than fi fty program units. The ques t ion ma y then be asked: if a programmer res tr icts the number of program units per subsys tem, ho w does t his aff ect t he P .S.C. e xpressed b y the sys t em? Is there a precise re lationship betw een a fi x ed upper limit to the number of program units per subsys tem and the maximum possible configuration ef ficiency of a sys tem? The answ er to this last ques tion is yes. If a programmer rest r icts the number of program units per subsys tem to x , sa y , and if p is the regional inf or mation hiding violation (the number of public program units per subsys tem) then t he maximum possible configuration eff iciency of that sys t em as it gro w s indefinitely lar g e is give n b y the equation (see theorem 2.3): lim n ∞ c e = 1 − p x This maximum possible configuration eff iciency of an indefinitely lar g e syst em as is called the conf iguration efficiency limit. Thus in the sys tem discussed abo ve, if the programmer res t ricts the num ber of program units per subsy stem t o f ifty and wit h each s ubs y stem containing one public program unit, then the configuration ef ficiency limit of that sys t em is: lim n ∞ c e = 1 − p x = 1 − 1 50 = 0.98 If the programmer restricts the same sy stem to 1 0 program units per subsys tem, t he configuration ef ficiency limit will be 0.9, as sugg ested b y figure 24, sho wn in t he introduction. 2. Sys tem information hiding. Examing at the data in table 2, we see that Jboss, f or e xample, has a configuration eff iciency of 0.02 and the number of public classes e xpressed as a percentage of the total number of classes is 98%. Expressing this percentage as a ratio, w e see that Jboss's public-to-to t al class ratio is 0.98, which seems t o be one minus the conf iguration efficiency . Eclipse, similarl y , as a configuration eff iciency of 0.4 and a ratio of 0.6 1 , again, appro ximatel y one minus the configuration eff iciency . The ques t ion ma y then be asked: is there a precise re lationship betw een the maximum possible configuration ef ficiency of a sys tem and t he ratio of the number of inf or mation hiding violational program units divided b y t he to tal number of program units? The answ er is y e s. If the total number of a program units in a sy stem is n and the total number of inf or mation hiding violational program units is |h(G)| then the c onfiguration effi ciency limit can also be e xpressed as (see theorem 2.4): lim n ∞ c e = 1 − ∣ h G ∣ n The ratio in this equation is the ratio of the number of public classes divided b y the total number of classes in a sy stem. This equation onl y holds f or larg e sys tems, which is wh y t able data cor relate more s trongl y for the lar g e r than the smaller sys tems. This also presents a method f or calculating a con v enient appro ximation to the confi guration efficiency f or larg e sy stems. Conclusions This paper sugg e s ts both that the moder n practice of constraining pac kages sizes is a viable mechanism f or m anaging the P .S.C. of indefinitely lar g e syst ems, and that the maximum possible configuration ef ficiency of indefi nitel y larg e sys tems is related t o the total number of inf or mation hiding violational program units. Appendix A Theorem 2. 1 . Giv en a unif or ml y distributed, encapsulated graph G of n node s and of r encapsulated regions, with each encapsulated region ha ving an inf or mation hiding violation of p, the configuration inef ficiency c i is giv en b y t he equation: c i = n r rp − 2 np n − 2 np p Pr oof: From sect ion 6.5.4. of [1], the conf iguration ineffic iency is giv en b y: c i = s G − s min G s max G − s min G (i) Where: s(G) = actual sy stem P .S.C. s min (G) = minimum sy stem P .S.C. s max (G) = maximum sy stem P .S.C. From theorem 1 . 1: s max (G) = n(n – 1) From theorem1 .8: s G = n n r − 1 r − 1 p From theorem 1 . 1 4: s min G = n 2 np − 1 − p Substituting all three eq ua tions into (i) gi v es: c i = n n r − 1 r − 1 p − n 2 np − 1 − p n n − 1 − n 2 np − 1 − p = n r − 1 r − 1 p − 2 np − 1 − p n − 1 − 2 np − 1 − p = n r − 1 rp − p − 2 np 1 p n − 1 − 2 np 1 p = n r rp − 2 np n − 2 np p QED Theorem 2.2. Giv en a unif or ml y distributed, encapsulated graph of n node s and of r encapsulate d regions, with each encapsulated region ha ving an inf or mation hiding violation of p, the conf iguration eff iciency c e is giv en b y t he equation: c e = n p n r − rp n − 2 np p (i) Pr oof: From sect ion 6.5.4. of [1], the conf iguration eff iciency is giv en b y: c e = 1 - c i From theorem 2. 1: c i = n r rp − 2 np n − 2 np p Substituting i nto (i) giv es: c e = 1 - n r rp − 2 np n − 2 np p = n − 2 np p n − 2 np p − n r rp − 2 np n − 2 np p = n − 2 np p − n r − rp 2 np n − 2 np p = n p − n r − rp n − 2 np p QED Theorem 2.3. Giv en a unif or ml y distributed, encapsulated graph of n node s and of r encapsulate d regions, with each encapsulated region ha ving an inf or mation hiding violation of p, and giv en that t he i th encapsulated region K i contains t he fix ed number x nodes, the limit of the configura tion efficiency as the gra ph gro ws indef initel y larg e is give n b y: lim n ∞ c e = 1 − p x Pr oof: From theorem 2.2: c e = n p − n r − rp n − 2 np p (i) By definition: x = n r and so r = n x Substituting bo t h of these equations into (i) giv es: c e = n p − x − np x n − 2 np p = n n p n − x n − np nx n n − 2 p n p n = 1 p n − x n − p x 1 − 2 p n p n T aking the limit as n tends to infinity giv es: lim n ∞ c e = 1 − p x 1 = 1 − p x QED Theorem 2.4 Giv en a unif or ml y distributed, encapsulated graph G of n node s and of r encapsulated regions, with each encapsulated region ha ving an inf or mation hiding violation of p, and giv en that G has an inf or mation hiding violation of h(G) , the limit of the conf iguration efficiency as t he graph gro ws indefinitely lar ge is giv en b y: lim n ∞ c e = 1 − ∣ h G ∣ n Pr oof: From theorem 2.3, where the i th encapsulated region K i contains t he fix ed number x nodes, the limit of the configuration eff iciency of G as the graph g ro w s indef initel y larg e is giv en by : lim n ∞ c e = 1 − p x (i) By definition: ∣ K i ∣ = x = n r Substituting this into (i) giv es: lim n ∞ c e = 1 − rp n (ii) But b y item (iii) of def inintion D22 in [1]: p = ∣ h K i ∣ = ∣ h G ∣ r Substituting this into (ii) giv es: lim n ∞ c e = 1 − r ∣ h G ∣ rn = 1 − ∣ h G ∣ n QED References [1] ”Encapsulation theor y fundamentals,” E d Kir w an, www .EdmundKir w a n.com/pub/paper1 .pdf [2] ”Encapsulation theor y : the conf iguration efficiency limit,” Ed Kirw a n, www .EdmundKir w an.com/pub/paper2.pdf
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment