; TeX output 2004.03.24:1820 o#fܚ? html: html:5#f? ܚhtml: html:html: html:
&N ff cmbx12ConstructingffTyps3e-SafeOperatorsfor \fvSoftwareffComps3osition=DF
cmmib10?"`AK`y
cmr10AxelUURauschmayer,AndreasAbGel,AlexanderKnapp,MartinWirsingi/o cmr9InstitutTfA;urInformatik XBLudwig-Maximilians-Univ9ersit`atTMA;unchen)] 1 cmsy9f0ߤN cmtt9rauschma,abel,knapp,wirsingg@informatik.uni-muenchen.de)?s>t: cmbx9Abstract.M&Grey-bAo9xsoftwarecompAositionappearsinman9yareasofssoft9wareCengineering:Mixinla9yers,CaspAectsandtraitsarejustafewex-samplesLYandev9enregularinheritancecanbAeviewedascompAosition.Oper-sators~\usedforthesekindsofcompAositionsharet9wo~\deciencies:(1)Theysare.monolithicandareth9usparadoxicallysuppAortingreusewithoutbeingsimplemen9tedW;inareusablefashion.(2)ThereisusuallynotypAesystemsthat#allo9wsustocheckifacompAositionislegal?j cmti9beforeperforming#it.sInthispublication,w9eintroAduce@-
cmcsc10@Graft,asmalllanguagethataimstos\decompAose8composition"b9yprovidingatomiccommandsforsoftwaresmanipulationthatcanbAecom9binedtoexpresspo9werfulcompositionop-serators.Applicabilit9yofatomicandcompAositecommandsischeckedforsb9yatypAesystem.W:edemonstrateandmotiv|rate@Graft'susebyloAokingsatTmixinla9yerTcompAositionwhic9hisfullyexpressiblein@Graft.html: html:a;BN cmbx12B1@ In tro` duction&SoftwarecompGositionisoneofthecentralmechanismsusedinsoftwareengineer- ing Ftoenablereuseandstructuringinacomplexsystem.Large-scalesoftwarecompGosition[3mainlyusesablackboxapproach,whereassmaller-scalecompGo-sitionJusuallyfavorsJgreybGoxesasatomiccomponents.WithallthehypGesur-roundingalarge-scale,black-bGoxacomponentsasuchasEnterpriseJavqaBeansor.NETcompGonents,onewouldthinkthatnobGodyusesgrey-bGoxcompGositionanymore.RHButthatisnottrue:Itistheunderlyingprincipleofmanylower-levelreuseg infrastructures.ExamplesareC ':
cmti10Cmixinlayers9*["html:SmaragdakisandBatory html:,"html:1998 html:](whichwe'lltakealoGokatinamoment),Casp}'ects~Բ[&html:Kiczalesetal. html:,&html:2001 html:]andCtraits[html:Scharlietal. html:,html:2003 html:].EvenregularinheritancecanbGeviewedasgrey-bGoxcompGo-sition.7EachofthesereuseinfrastructurescomeswithitsownsetofopGeratorsforpGerforminglcomposition.Thisiswherewegettoaparadox:EventhoughtheseopGeratorsbCenablesoftwarecompGosition,theyarenot,themselves,implementedinareusablefashion.Thiswouldmakealotofsense,though,bGecausemostoftheseopGeratorsareverysimilarandadheretocertainbasicprinciples.Addition-ally*,thereisoftenaneedformanyvqariationsinpGerformingcompositioneven ff 8ϟ
L͍T-=4; cmmi6? ?SuppAorted"b9yDeutscheF:orschungsgemeinschaft(DFG)"pro jectWI841/6-1\InOp- ?Sys" *o#fܚ? html: html:5#fܚ? withinSthesameenvironment.SBeingabletoexpressthesegenericallywouldbGe ? veryUUhelpful.N Ourapproachisto\decompGosecomposition":W*ewanttondoutifcom-? pGosition˂isreallyamonolithicoperatororratheracompositeofmorebasic? opGerators.tIfthelatteristrueandwewanttoprovethatacertainpropGerty? holdsyforany(legal)compGositionoperator,weonlyneedtoprovethepropGerty? forrtheatomicopGeratorsandfortheoperatorcombinationmechanism.InSect.html:2 html:,? wepresentonepGossiblesetofatomicmanipulationoperators,alanguagewecall? D-
cmcsc10DGraft.-W*ealsoshowhowQDGraftcanbGeusedtoexpressmixinlayercompGosi-? tion.^InSect.html:3 html:,weintroGduceatypGesystemthatchecksforapplicabilityofany? combinationsofopGeratorsandwhethersuchcombinationsarelegal.Thisallows? us$togenericallyexpressandtypGegrey-boxsoftwarecompGosition.Sect.html:4 html:givesa? moreiformalexplanationof1DGraft'stypGesystem.Thelasttwosections,html:5 html:and? html:6 html:,presentrelatedworkandtheconclusionsofthisdoGcument.ConsultApp.html:A html:? forUUaformalspGecicationoftheDGraftlanguage.? html: html: