资源描述:
《java needs compound types》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、JavaNeedsCompoundTypesMartinBuchi¨TurkuCentreforComputerScienceLemmink¨aisenkatu14A,FIN-20520TurkuMartin.Buechi@abo.fiWolfgangWeckTurkuCentreforComputerScienceLemmink¨aisenkatu14A,FIN-20520TurkuWolfgang.Weck@abo.fiTurkuCentreforComputerScienceTUCSTechnicalReportNo182May1998ISBN952-12-0224-6ISSN1239
2、-1891AbstractWeproposetoextendtheJavatypesystemwithanewconstruction:compoundtypes,compositionsofaclassandanynumberofinterfaces.Javauserswillbenefitfromthetypesystem'sincreasedexpressiveness,re-sultinginmorekindsoferrorsbeingstaticallyexcludable.Compoundtypesareparticularlybeneficialwhenseveralindep
3、endentlypredefinedstandardsneedtobeconsidered,astypicallyrequiredbycomponentsoftware.CompoundtypesareastrictextensionofJava,i.e.,existingprogramsneednottobemodified.Ourpro-posalcanbeimplementedusingtheexistingJavaVirtualMachine.Ourscientificcontributionisanewcombinationofnameandstructuraltypeequivca
4、lence,whichourJavaextensionexemplifies.Typematchingisdecidedbystructuralcomparisonofcompositionsofnamedtypes;thelatterbeingonlycompatibleifexplicitlydeclaredso.ThisconceptisapplicabletoseveralotherlanguagesthanJava,aswell.Wesupportthefeasibilityofourproposalbyaformalandmechanicallyveri-fiedproofoft
5、heextendedtypesystem'ssoundness.Keywords:componentsoftware,combiningnameandstructuralequivalenceoftypes,behavioraltyping,intersectiontypes,Java,languageextensionTUCSResearchGroupProgrammingMethodologyResearchGroup1IntroductionOneofseveralreasonstouseJavaisitssupportofcomponent-orientedprogram-min
6、g,thecreationofcompiledbuildingblockstobeusedindifferentcontexts,andtheassemblyofsystemsfromsuchcomponents.JavaBeans[34],Java'scomponentmodel,competeswithothercomponentsoftwarestandards,suchasCORBA[13]andMicrosoft'sCOM[31],butthelanguageitselfmayalsobeusedtoprogramtotheselanguageindependentstanda
7、rds.Typesystems,suchasJava's,helptodocumentandsafeguardcomponentin-terfaces.Byannotatinginter-componentcallparameterswithtypes,oneprovidessomeprimitivedocumentationonhowtouseaserviceandatthesametimeex-pressesastaticall