136 16 41MB
English Pages 569 [565] Year 1998
Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen
1357
Berlin Heidelberg New York Barcelona Budapest Hong Kong London Milan Paris Santa Clara Singapore Tokyo
Jan Bosch Stuart Mitchell (Eds.)
Object-Oriented Technology ECOOP’97 Workshop Reader ECOOP’97 Workshops Jyv¨askyl¨a, Finland, June 9-13, 1997 Proceedings
13
Series Editors Gerhard Goos, Karlsruhe University, Germany Juris Hartmanis, Cornell University, NY, USA Jan van Leeuwen, Utrecht University, The Netherlands
Volume Editors Jan Bosch Department of Computer Science and Business Administration University of Karlskrona/Ronneby S-372 25 Ronneby, Sweden E-mail: [email protected] Stuart Mitchell Department of Computer Science, University of York York, YO1 5DD, UK E-mail: [email protected]
Cataloging-in-Publication data applied for Die Deutsche Bibliothek - CIP-Einheitsaufnahme Object-oriented technology : ECOOP 97 workshop reader ; proceedings / ECOOP 97 workshops, Jyv¨askyl¨a, Finland, June 9 - 13, 1997. Jan Bosch ; Stuart Mitchell (ed.). - Berlin ; Heidelberg ; New York ; Barcelona ; Budapest ; Hong Kong ; London ; Milan ; Paris ; Santa Clara ; Singapore ; Tokyo : Springer, 1998 (Lecture notes in computer science ; Vol. 1357) ISBN 3-540-64039-8
CR Subject Classication (1991): D.1-3, H.2 ISSN 0302-9743 ISBN 3-540-64039-8 Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microlms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are liable for prosecution under the German Copyright Law. c Springer-Verlag Berlin Heidelberg 1998 Printed in Germany Typesetting: Camera-ready by author SPIN 10661353 06/3142 – 5 4 3 2 1 0
Printed on acid-free paper
ECOOP’97üWorkshopüReader Preface JanüBosch UniversityüofüKarlskrona/Ronneby DeptüofüComputerüScience SoftCenter,üS-372ü25,üRonneby,üSweden [email protected]
1
StuartüMitchell UniversityüofüYork DeptüofüComputerüScience York,üUnitedüKingdom [email protected]
Introduction
Althoughü becomingü moreü acceptedü inü softwareü industry,ü object-orientedü technology stillü isü anü activeü eldü ofü researchü withü manyü issuesü remainingü toü beü addressed.ü This workshopü reader,ü inü aü way,ü presentsü theü widthü ofü theü ongoingü researchü activitiesü in object-orientation.üHowever,üweüfeelüoneücanüclassifyütheseüactivitiesüintoüthreeücategories: • Domain-specic:üSeveralüactivitiesüfocusüonüaüsingleüapplication,üe.g.ütelecommunication,üorücomputer-science,üe.g.üreal-timeüandümobility,üdomain.üResearch triesütoüaddressütheüdomain-specicüproblemsüofüobject-orientedütechnology. • Designüissues:üObject-orientedüdesignühasübeenüanüissueüforüatüleastüaüdecade, butüoneücanüidentifyüanüincreasingüfocusüonüformalüapproachesüandüonütheüevolutionüandüre-engineeringüofüexistingüobject-orientedüsoftware. • Beyondü object-orientation:ü Theü object-orientedü paradigmü will,ü atü someü point, beüreplacedübyüaüsubsequentüparadigmüandüseveralüresearchüeffortsüinvestigate alternativeü orü extendedü approaches.ü Examplesü areü extendedü languageü expressivenessü for,ü e.g.ü designü patternsü andü frameworks,ü component-orientedü programmingüandüaspect-orientedüprogramming.
2
Contents
Theüremainderüofüthisübooküisüaüselectionüandüre-iterationüofütheücontributionsütoü12 workshopsü(ofüaütotalüofü15)üheldüduringütheüECOOP’97üconference.üTheüworkshops generallyürelateütoüoneüofütheüaboveücategories. PartüIüisüconcernedüwithütheüuseüofüobject-orientedütechnologyüforüinütelecommunicationsüdomain,üinüparticularüserviceüengineering.üDueütoütheübreakingüofütheümonopoly ofü traditionalü telecommunicationü providers,ücompetitionü hasüincreasedü rapidly.üSince theü competitiveü edgeü isü inü servicesü ratherü thanü connections,ü theü organisersü predictü a shiftü toü aü service-drivenü telecommunicationü market.ü Toü developü newü servicesü with shortütime-to-market,ülowücomplexity,ühighüreusability,üetc.,ütheüobject-orientedüparadigmüisüconsideredütoübeütheümostüsuitableücandidate.
Reectiveü real-timeü object-orientedü programmingü andü systemsü areü discussedü in PartüII.üReal-timeüsystemsühaveütraditionallyübeenüveryüstaticüwhichüresultsüinüchanges toüsystemübehaviourüduringütheüsoftwareülifecycleübeingüveryücostly.üAnüimportantüarea ofü real-timeü researchü isü howü toü makeü systemsü exibleü andü adaptiveü whilstü retaining guaranteesüaboutütheirütemporalüproperties.üReection,üi.e.ütheüabilityütoüperformücomputationü onü theü systemü itself,ü isü seenü asü aü potentialü mechanismü forü achievingü these goals. PartüIIIüdiscussedütheüproblemsüofüconventionalülanguagesüforütheüimplementation ofüdesignüpatternsüandüobject-orientedüframeworksüandünewüapproachesütoüdescribing andüimplementingüdesignüpatternsüandüframeworks.üOneücanüidentifyüthreeücategories ofü approaches,ü i.e.ü designü environmentü supportü visualizingü structuresü otherwise implicit,ü theü generativeü approach,ü i.e.ü aü toolü generatingü aü codeü skeletonü thatü canü be lledü inü withü application-specicü code,ü andü programmingü languageü extensionsü that provideürst-classürepresentationsüforüdesignüpatternsüorüframeworküconcepts. PartüIVüdiscussesütheüsemanticsüofüobject-orientedümodellingütechniques.üTheüparticipants,üamongüothers,üreactedüagainstütheütraditionalüsignature-basedüwayüofüdescribingü standards:ü Inü additionü toü aü preciseü syntax,ü alsoü preciseü semanticsü needsü toü be specied.üThisüwould,üamongüothers,üallowüforüdetectingüinconsistenciesüandüinaccuraciesüandüforücomparingüdescriptionsüforütheirüsemanticüequivalence. PartüVüisüconcernedüwithüdistributedüobject-orientedücomputing,üinüparticularümethodologicalüandüimplementation-orientedümodelsüandüformalümodellingütechniques.üThe participantsüconcludedüthatüenablingütechnologiesüsuchüasüCORBAüandüJavaüRMIüstill lacküaürmügroundüsinceünoüde-factoüstandardüofüdistributedüOOücomputingüexists.üOn theüotherühand,üitüisüunclearühowüformalünotationsüsuchüasüPetriüNets,üEstelleüandüLotos canü supportü theü object-orientedü paradigm.ü Finally,ü methodologicalü supportü forü these systemsüisüstillüinütheüearlyüstages. Partü VIü studiesü theü evolutionü andü re-engineeringü ofü existingü object-orientedü software.ü Evenü thoughü theü object-orientedü paradigmü isü oftenü thoughtü toü beü superiorü to olderüapproachesüwithürespectütoümaintenance,ütheülargeübodyüofücomplexüandüexpandingü object-orientedü softwareü isü placingü anü increasingü burdenü onü softwareü engineers. Theüevolutionüandüre-engineeringüofüobject-orientedüsoftwareüisüaücomplexüandümultifacetedüproblemüthatüneedsütoübeüstudiedüfromüseveralüperspectives. Theü modellingü ofü softwareü processesü andü artifactsü isü discussedü inü Partü VII.ü The relationütoüobject-orientedütechnologyüisütwofold.üFirst,üobject-orientedüsoftwareüdevelopmentürequiresü explicitü modellingüofüitsüprocessesü andüartifacts.ü Secondly,üsoftware processesüandüartifactsücanübeümodelledüusingüobject-orientedüprinciples. PartüVIIIüisüconcernedüwithücomponent-orientedüprogrammingü(COP).üCOPüisüoften referredütoü asütheü nextüstepü beyondüOOPüandüCOPüis,üamongüothers,üdifferentü inüthe focusü onü constructingü systemsü fromü independentlyü developedü components.ü Research issuesü includeü theü relationü toü softwareü architecture,ü theü non-functionalü requirements thatücomponentsüshouldüfullüandütheüglue-ingüofücomponentsüduringüapplicationüconstruction. Partü IXü presentsü theü doctoralü studentsü workshop.ü Differentü fromü theü otherü workshopsüthatüfocusüonüaütechnicalütopic,üthisüworkshopüpresentsüaüwideüvarietyüofüresearch topics.üInstead,ütheücommonüdenominatorüisütheücurrentüoccupationüofüitsüparticipants.
Nevertheless,ütheüpartüpresentsüanüexcellentüoverviewüofüongoingüresearchüactivitiesüin object-orientation. TheütopicüofüPartüXüisüobject-orientedüreal-timeüsystems.üDespiteüearlyüscepticism, object-orientedütechnologyühasübecomeümoreüwidelyüusedüinüreal-timeüsystems.üHowever,üthereüremainüseveralüresearchüissuesüsuchüasügeneratingücodeüfromüRTüspecications,ü validationü andü testingü ofü dynamicü behaviourü andü theü relationü betweenü objectorientedü real-timeüsoftwareüandü conventionalükernels.üInüthisüpartütheüfocusü isüonü the modellingüofüobject-orientedüreal-timeüsystemüandüonüimplementationütechniques. Aspect-orientedüprogrammingüisüdiscussedüinüPartüXI.üOneücanüidentifyüaügeneral awarenessüthatücodeütanglingüreducesütheüquality,üe.g.ümaintainabilityüandüreusability, ofü software.ü AOPü isü concernedü withü approachesü toü separatelyü describeü theü various aspectsüofüaücomponentüorüsoftwareüsystemüandütoücomposeüthemüatüaülaterüstage.üHowever,üvariousüapproachesütoüachievingüthisüseparationüofüconcernsücanübeüidentiedüand theüpartüdenesüaücharacterisationüofüAOPüandüidentiesüresearchüissues. PartüXIIüisüconcernedüwithüoperatingüsystems.üModernüoperatingüsystemsümust,üin additionütoütheütraditionalürequirementsüofüperformanceüandüusability,üfullüadditional requirementsüsuchüasüexibility,üadaptabilityüandüscalability.üTheüobject-orientedüparadigmü providesü propertiesü thatü helpü achieveü theseü requirements.ü Operatingü system issuesüdiscussedüinüthisüpartüare,üamongüothers,üreection,ücongurationüofüadaptable operatingüsystemsüandüvirtualümachines.
3
Aboutütheüdiversityüofütheüsubmissions
Aüworkshopüreaderüis,übyüitsünature,üveryüdiverseüinüitsücontributions.üThisüreaderüisüby noümeansüanüexceptionütoüthatürule.üTheücontributionsühaveüaüwideüdiversityüinütopicsüas wellüasütheüformüofüpresentation.üSomeüworkshopsüareürepresentedüonlyübyüaüworkshop reportü whereasü otherü workshopsü primarilyü presentü theü participantsü papersü andü spend limitedüeffortüonüsummarizingütheüworkshop.üAsüeditors,üweühaveügivenütheüorganisers muchüfreedomüinütheüpresentationüofütheirüworkshop.üWeüconsideredütheücontentsüofüthe partsü moreü importantü thanü theirü uniformityü andü weü doü notü believeü thatü thisü would decreaseüreadability.
4
Acknowledgements
Anüincredibleüamountüofüpeopleühasübeenüinvolvedüinücreatingüthisüworkshopüreader,üin particularüallüauthorsüandüworkshopüorganisers.üAsüeditors,üweümerelyücomposedütheir contributions.üThisüworkshopüreaderüpresentsüanüimportantücontributionütoüobject-orientedü researchü andü weü wouldü likeü toü expressü ourü sincereü appreciationü toü everyone involved.
ior model intended for the specication and the validation of distributed applications is an important requirement for a better specication of distributed application components. Indeed, without a precise, unambiguous and correct specications it is difcult available. The challenge is to provide effective specication and validation frameworks [17]. A NMF-Ensenble denes a any behavior specication of involved managed objects. Object frameworks are a more is to dene a suitable behavior model based on executable specications to allow the In terms of expressiveness of the specication framework, nondeterminism and dy
1
Specication Framework
depending on the use of control abstractions to organize the specications of actions in
are dened. Putting this two notions together denes in its turn the concept of coherent phase. The congurations of the system between its atomic transition steps dene naturally its states. The overall behavior of the system can be dened either by . This denes the concept of ition systems are used by verication tools as a backend representation [2]. Because specication is a human activity the availability of higher level abstractions is mandatory to allow the specication of state
calculi [9], or automatas as in automata based specication languages [16]. Processes system into well identied and manageable pieces. Actions are typically organized on such control structures, i.e. actions are specied based on the local (control) states that are dened in each process / automata in the system. Because of the emphasis that is put on control issues in the conguration of the system such models are referenced as An action is dened as in RM-ODP2 [15] very generally by anything happening in the system. One
1.4
Declarative Specication of Actions
the sense that it contains both a specication of the conditions required for its activation, a specication of its effects, and a specication of any other constraint that it of the system. Effects are typically specied as data state changes, and constraints are assertional conditions on data states that have to be veried at well identied places, Since the conguration of the system is dened only w.r.t. data abstractions, such mod
One of the rst models proposed for the specication of concurrent systems was Di guarded commands is nondeterministically selected to be red. In general instead of contrast, control oriented models can be viewed as renements of data oriented models intended to model specic features of the real world. For instance, automata based each step, the local control state in each automata / process denes the set of enabled knowledge is available and relevant at a give stage of specication. This implies that quencing within each process or automata. In ODP terms this implies that a signicant part of the engineering viewpoint issues are xed. A model of the actual distribution specication of functional issues, an engineering viewpoint model is absolutely not re framework, based on the declarative specication of actions, where control issues are specied minimally is more adapted for the purpose of functional modeling.
where the contexts of utilization of objects has to reect the application requirements. objects or object congurations. Each object is intended to fulll a well identied role in the conguration. The role can be used as an identier for objects [15] involved in specication of behavior, but this identier has a high level semantics value w.r.t. the A role denes a subtype for an object in the sense that an object fullling a role is still compatible with the core specication of the object itself, i.e. it still observes the interfaces dened on the core object. However, the behavior resu interactions on such interfaces with other objects is dened w.r.t. the role. For instance specic state information may be associated to a role and updated with other objects are specied using object references based on the role identiers available in the object conguration, e.g. an object in the The advantages are that (i) much more expressive and readable behavior specications these variants need to be dynamically available. Note that the set of roles fullled may modeling, they merely reect properties of real life systems. Interestingly, role model used to model and analyze management policy conicts [10].
The concept of relationship follows directly from the need to model conguration of
cations it turns out that the generic relationship model (GRM) [5] is suitable to dene can not be dened precisely using GRM. In addition they are dened only using CMIS
Validation of a specication consists to check the correspondence between informal requirements and the formal specication. Three techniques are commonly used : specications. consists to prove properties about a specication. reasoning have been opposed for ages. Executable specications are often qualied than proving more general properties. However, with declarative specications it can In addition, executable specications are much more prone to the involvement of users. vides an excellent communication vehicle between users, speciers and developers. In which is still a difcult problem in the currently available tools. Note that to allow for the executability of declarative specications of actions a precise execution semantics
By deliberately limiting our ambitions to the specication and validation of functional mation and computational viewpoint modeling. The declarative specication of actions
requirements. Roles dene object subtypes dynamically available, object congura Finally, validation is based on the principle of executable specications. This is a prag as telecom engineers both in terms of specication and validation.
(cæsar/aldebaran development package): A protocol validation and verication toolbox. In 3. Norbert E. Fuchs. Specications are (preferably) executable. Technical Report 92, Univer ://ftp.i.unizh.ch/ 6. I.J. Hayes and Jones C.B. Specications are not (necessarily) executable. Technical Report 7. H. Jarvinen and R. Kurki-Suonio. DisCo Specication Language: Marriage of Action and , 1991. Available at www.cs.tut.. ior Specications 10. Emil Lupu and Morris Sloman. Conict Analysis for Management Policies. In 16. C. C. I. T. T. Functional Specications and Description Language (SDL). Rec. z.100-z.104,
Weak Protection for Reective Operating Systems
ple of the advantage of extensible operating systems. We have applied the reec ective operating system workable. We are currently developing this mechanism
1 A Reective Operating System Although there are various denitions of reective systems, a typical reective system . Also, (1) the reective systems should enable scope control by the users so that The two design criteria presented above are effective in most of reective systems such as the CLOS MOP [4] and OpenC++ [2], but they are not sufcient for designing reective operating systems. We need the third design criterion, which is system from a malicious or wrong user program, a reective operating system also
To avoid serious performance overheads, our experimental reective operating system signicantly reduced against the Mach’s approach. This is due to the fact that most of user-dened metaobjects are short programs and the costs of the interpretation is not The operating system we developed is a preliminary version; the reective feature virtual memory status because our reective system allows the metaobject to access To examine the benets of our customizable thread scheduler, we implemented three different scheduling policies on top of it. The rst policy uses time constraints and the deadline-rst policy, which is the default policy of our scheduler. This policy is directly default earliest-deadline-rst scheduler. The line marked “I/O” is by the scheduling with
default earliest-deadline-rst scheduler despite overheads by the interpretation. This is if the implemented scheduling policy is signicantly better than the default one, the
real-time scheduling presented above, its inefciency due to interpretation limits the applicability of reection to operating system design. With an in-kernel interpreter, reection is effective only if the gain by customization is sufciently large. In fact, another
ciency, the protection for metaobjects does not need to be as strict as that for user Currently, we have two different implementations of the weak protection. The rst
One of the reasons of the inefciency of the Mach’s approach is that a metaobject local memory. It reads and modies this data structure and calls a library function again if it needs to write the modied data structure back to the shared memory. The coping efcient than the library approach, but it restricts the kind of possible programming language. Another disadvantage is its less exibility; if the shared memory is protected by metaobject more efciently after debugging is nished.
64-bit address space is extremely large, a metaobject can be efciently isolated from vantage is that it needs signicantly small runtime penalties. For inter-metaobject calls, it does not need TLB ush or a system trap but only a special calling convention. In
signicant exibility to the users since they can customize the library and build their
4. Kiczales, G., J. des Rivi`
Workshopüon LanguageüSupportüforüDesignüPatternsüandüFrameworks (LSDF’97) Introduction JanüBosch
GšrelüHedin
UniversityüofüKarlskrona/Ronneby DeptüofüComputerüScience SoftCenter,üS-372ü25,üRonneby,üSweden [email protected]
LundüUniversity DeptüofüComputerüScience Boxü118,üS-221ü00üLund,üSweden [email protected]
KaiüKoskimies UniversityüofüTampere DeptüofüComputerüScience Boxü607,üFIN-33101,üTampere,üFinland
ThereüisügrowingüinterestüinütheüroleüofülanguagesüinüemployingüreusableüOOüarchitectures.üInüparticular,üOOüframeworksüandüdesignüpatternsücanübeürelatedütoülanguagesüin variousü ways.ü Moreü concretely,ü weü recogniseü theü followingü topicsü whereü languages, patternsüandüframeworksücomeütogether: •
Languageüsupportüforüdesignüpatterns:üDesignüpatternsüareüprimarilyüusedüasüa designütechniqueüandüonlyülimitedüattentionüisüpaidütoütheirüimplementation.üA numberüofüresearchersühaveüinvestigatedüdifferentüwaysüofüprovidingülanguage supportüforüdesignüpatterns,üe.g.übyürepresentingüthemüasülanguageüconstructsüor byütemplateücodeügeneration.üHowever,ütheüissueüisüfarüfromüsolvedüandüshould beüinvestigatedüfurther.
•
Frameworküinstantiationülanguages:üLately,üsomeüauthorsühaveüproposedütheüuse ofüspecicüinstantiationülanguagesüforüframeworks.üEspeciallyüblack-boxüframeworksü inü wellü understoodü domainsü couldü benetü fromü suchü languages,ü since theyüsimplifyüinstantiationüofütheüframeworküconsiderably.üHowever,ütheüactual designüandüimplementationüofüsuchülanguagesüisünotüwellüunderstoodüandüneeds toü beü furtherü investigated.ü Also,ü whenü composingü frameworksü forü useü inü an application,ütheüinstantiationülanguagesümayüconictüwithüeachüother.
•
Frameworküextensionüsupport:ü Aü well-knownüproblemüwithüwhite-boxüframeworksüisüthatütheyüareüdifcultütoüextend.üOneümayüneedüquiteüdetailedüunderstandingüofütheüimplementationüofüframeworküclassesüinüorderütoüknowühowüthey shouldübeüsubclassed.üLanguageütechniquesümightübeüableütoülessenütheseüprob-
lemsübyügivingüsupportüforücheckingütheüextensionsüandügivingüframework-specicüeditingüsupportüforüdoingücorrectüextensions. •
Domainüspecicülanguageüextensionsütoüsupportüframeworks:üWhenüconstructingüorüusingüframeworküinüaüparticularüdomain,üthereümayübeüdomainüconcepts thatü areünotüeasilyüexpressedüasü classesü orüobjects.ü Suchüdomainüconceptsücan oftenü beü expressedü asü languageü constructsü andü reusedü asü such.ü Traditionally, softwareüengineersühaveüdealtüwithüthisüthrough,üforüexample,ütheüuseüofümacros andüpreprocessors,übutümoreüintegratedüandüstructuredüapproachesüareürequired.
•
Framework-basedü languageü implementation:ü Frameworksü provideü anü interestingü basisü forü implementingü domain-orientedü languages:ü generalü domainü concepts,üpresentedüasüabstractüclasses,ücanübeüspecializedüintoüconcreteülanguage structuresüandüreusedüinümanyülanguages,üallowingüfastüdevelopmentüofüdomainorientedü languages.ü Althoughü thereü areü toolsü supportingü this,ü theü processü of derivingülanguagesüfromüabstractüconceptsüisünotüwellüunderstood.
Theügoalüofüthisü workshopüwasü toü bringütogetherüresearchersüactiveüinütheüaforementionedüareasüandütoüprovideüanüinteractiveüforumüforütheüexchangeüofüideas,üresults,üand openü problemsü inü thisü area.ü 14ü submittedü papersü wereü selectedü forüpresentationü and, whenücombined,ütheyücoverümostüofütheüidentiedütopics. Toüobtainüaühighüdegreeüofüinteractionüatütheüworkshop,ütheüpresentationsüwereükept short,ü andü afterü eachü sessionü consistingü ofü 2-4ü papers,ü aü 15ü minuteü panelü discussion withütheüsessionüauthorsüwasüheld.üAtütheüendüofütheüworkshop,üanü“open-mike”üsession wasüheld,üallowingüalsoünon-authorüparticipantsütoüinitiateüaüdiscussionüonürelatedütopics.ü Thisü schemeü workedü outü veryü well,ü givingü goodü discussionsü andü anü interactive informalüatmosphere. InüthisüWorkshopüReaderü3-4üpagesüsummariesüofüallütheüpapersüareüpresented.üThe fullüpapersüareüavailableüelectronicallyüat http://www.ide.hk-r.se/~bosch/lsdf/. Theüpapersüwereüpresentedüinüveüsessions,übrieyüintroducedübelow. MessageüInterceptionüforüDesignüPatternüImplementation Thisüsessionü containedütwoüpapersü discussingü theüimplementationüofüdesignüpatterns. Boschü introducedü theü sessionü andü theü workshopü byü describingü theü problems, approachesüandürequirementsüofüprovidingülanguageüsupportüforüobject-orientedüframeworksüandüdesignüpatterns.üAsüexamples,ütheüsolutionsüdevelopedüinütheülayeredüobject modelüwereüdiscussed.üAlsoDucasseüintendsütoüdescribeüdesignüpatternsüasürst-class entities.üTheseüentitiesüareüspeciedüasütemplatesüandütheirüinstancesüinterceptümessages betweenüobjectsüinvolvedüinütheüdesignüpattern. RelationsüofüGeneral-PurposeüLanguages,üFrameworksüandüDesignüPatterns Thisüsessionüwasüintroducedübyüaüpaperüby GilüandLorenzüdiscussingütheürelationships betweenüdesignüpatternsüandüprogrammingülanguages,üandühowüfarüpatternsüinüdifferent categoriesüareüfromübeingüactualülanguageüfeatures.üTheüfollowingüpaperüby Agerboüand Cornilsümadeüthisüdiscussionümoreüconcreteübyülookingüinüdetailühowütheüprogramming languageüBETAüsupportsüparticularüdesignüpatterns.üTheünalüpaperüinüthisüsession,üby
DeüVolderüandDeüMeuter,üdiscussesühowütypeüsystemsüfromütheüfunctionalüprogrammingücommunityümightühelpüinüconstructingüreusableüOOüframeworks. Specication,üconsistencyüandüimplementationüofüdesignüpatterns Theürstüpaperüinüthisüsession,üby EdenüandYehudai,üpresentedüanüapproachüwhereüpatternüsolutions,ü“lattices”,ücanübeüspeciedübyütheüuseüofüaühierarchyüofü“tricks”,üdening lowerü levelü patternü solutions.Hedinü presentedü anüapproachübasedü onü attributeü grammarsü forü supportingü automaticü checkingü thatü theü patternsü areü appliedü consistentlyü in sourceücode,üwithütheüaimüofüsupportingüframeworküusageüandümaintenanceüofüsource codeüusingüpatterns.Jacobsenüproposedütheüuseüofüanü“extractülevel”ütoüviewüprogram codeüatüaümoreüabstractüconceptualülevel,üforüexampleütoüviewüdesignüpatternüapplications. Frameworküdenitionülanguages Matthijs, Joosen,üandRobbenüreportedüonüexperienceüfromüdeningüaüspecialülanguage forüaüframeworküforüconcurrentüdistributedüprogramming,üwithütheügoalüofüsimplifying frameworkü usage.ü Toü provideü anü openü implementation,ü theü frameworkü objectsü were madeüavailableüasümetaüobjectsüinütheünewülanguage. Bjarnasonüdiscussedüaütechnique forü supportingü framework-specicü languageü extensions,ü basedü onü APPLAB,ü anü integratedülanguage-designüenvironment.Peres, Malcolm, Vortman,üandZodiküpresentüan exampleüofüaüspecializationülanguage;ütheirülanguageüdenesüspecializationsüforüaüGUI framework. Nowacküproposesütheünotionüofüaüframeworkücomponent.üAüframeworkücan beü describedü asü aü setü ofü interrelatedü frameworkü components,ü eachü describingü an abstractionüoverüaü partü ofüaü framework.üAü frameworkü componentüorganizesü aüframeworküintoümoreüunderstandableü unitsü providingüexplicitü collectionsü ofüadaptableü hotspots. Languageüimplementationüframeworks Theülastüsessionüdiscussesütheürelationsüofüframeworksüandülanguagesüfromütheüperspectiveüofülanguages:ühowücouldütheüframeworküconceptübeüexploitedüinütheüimplementationüofütextualüorüvisualülanguages.üInütheüpaperüby Harsu,üHautamŠkiüandüKoskimies anüarchitectureüisüpresentedüforüaüframeworküsupportingüanalysisüofütextualülanguages. Theüframeworküandütheüaccompanyingügraphicalütoolü(TaLE)üisübasedüonüaüexibleütopdownüparsingüschemeüwhichüallowsütheüfreeücombinationüofüclassesürepresentingüvariousülanguageüstructures,üthusüfacilitatingühighüdegreeüofüreusabilityüofülanguageücomponents. Tuovinenü presentsü aü similarü frameworkü forü visualü languagesü basedü onü the atomicürelationalügrammarümodel.üThisüapproachümakesüuseüofüaügrammarüspecicationüofütheüvisualülanguageütoübeüimplemented.üTheüframeworküallowsüfastüdevelopment ofü variousü diagramü editorsü supportingü theüconstructionü ofüstructuresüfromüvisualü elements.üImplementingülanguagesüwithüframeworksüisüanüattractiveüapproachüespecially inüsituationsüwhereü theülanguageüisüconstantlyüevolvingüorügrowing.üThisümayübeü the caseüforüframeworküspecializationülanguages:üifüaüframeworküisüspecializedüintoüaümore narrowüframework,üitsüspecializationülanguageümayüalsoühaveütoüspecialized.
Multi-levelüpatterns FranküMatthijs,üWouterüJoosenü(+),üBertüRobbenü(*), BartüVanhaute,üPierreüVerbaeten Dept.üofüComputerüScienceü-üK.U.Leuven,üBelgium E-mail:ü[email protected] (*)üResearchüAssistantüforütheüBelgianüNationalüFundüforüScientificüResearch (+)üResearcherüforütheüFlemishüI.W.T.
Abstract It’sünoüsecretüthatüinstantiatingüframeworksücanübeüaütediousüprocess.üInüthisüpositionüpaper, weüproposeüourüsolutionütoütheüproblem,üwhichüconsistsüofüprovidingüanüapplicationüprogrammer withü aü languageü thatü supportsü highü levelü abstractions,ü andü automaticallyü instantiatingü the underlyingüframeworksübasedüonütheücodeüwrittenüinüthatülanguage.üApplicationüprogrammers useü onlyü theü language,ü notü theü underlyingü frameworks.ü Whileü thisü hidesü theü frameworks’ abstractions,üweücanümaintainütheüopenüarchitectureüofütheüframeworksübyümakingütheüinteresting objectsüfromütheühiddenüframeworksüavailableüagainüasümeta-objectsüatütheülanguageülevel.üThis leadsü toü aü systemü whereü objectsü (e.g.ü patternü participants)ü liveü atü threeü differentü levelsü of abstraction:ütheüobjectsüthatüareühiddenüinütheüunderlyingüframeworks,ütheübase-levelülanguage objects,üandütheümeta-levelülanguageüobjectsüthatüareüincarnationsüofütheüinterestingüobjectsüfrom theüunderlyingüframeworks.
1.üIntroduction Frameworksüareüimportantütoüleverageütheübenefitsüofüobjectütechnology,üandüallow forüreuseünotüonlyüofücode,übutüalsoüofüanalysisüandüdesign.üHowever,ücomplexüframeworksüareüdifficultütoüuse,übecauseütheüprogrammerühasütoüknowütheüframeworküatühand veryü well.ü Moreover,ü followingü allü theü necessaryü stepsü forü usingütheü frameworkü can becomeütedious.üAüpossibleüsolutionüweüproposeüinüthisüpositionüpaperüisütoüprovideüthe programmerüwithüaülanguageüthatüsupportsühigherülevelüabstractions.üTheücodeüthatüis writtenüinüthisülanguageüisüautomaticallyütranslatedüintoüanüinstantiationüofütheüunderlyingüframeworks. Ourümainüareaüofüexpertiseüisüinüdevelopingüobjectüsupportüsystemsüforüdistributed computerüarchitecturesü(e.g.ü[Bijnens]).üInüourüdevelopmentüprototypes,ütheüunderlying objectüsupportüsystemüconsistsüofüaüsetüofüdifferentüframeworksüthatüareüwrittenüinüC++. Weü haveü currentlyü builtü aü prototypeü ofü theü objectü supportü systemü runningü onü Dec Alpha,üSunüSolarisüandüSGI. Thisüpositionüpaperüisüstructuredüasüfollows:üweüfirstühighlightüinüsectionü2üaütypical patternüusedüinütheüobjectüsupportüsystemü(theüActiveüObjectüpattern),üandüweüillustrate inüsectionü3ütheühigherülevelülanguageüinterfaceüweüuseütoüexploitütheüframework.üSectionü4üdiscussesühowüweücanümaintainütheüopenüarchitectureüofütheüframework,üdespite theüfactüthatüit’sühiddenüforüanüapplicationüprogrammer.üThisüapproachüleadsütoümultilevelüpatternsüwhereüsomeüparticipantsüliveüinütheüsupportüframework,ühiddenüforüthe programmer,üandütheüappealingüparticipantsüliveüatütheülanguage’sümeta-level,üavailable forücustomizationübyüanüapplicationüprogrammer.üWeüconcludeüinüsectionü5. Thisü paperü isü aü shorterü versionü ofü theü originalü paper,ü whichü canü beü foundü inü the LSDFüworkshopüproceedings.
2.üActiveüObjectsüasüanüExample Theüaimüofüourüobjectüsupportüsystemüisütoüsupportüconcurrent,üobjectüoriented,üdistributedü applications.ü Toü thisü end,ü theü systemü isü builtü asü aü frameworkü incorporating manyü patternsü commonlyü usedü inü suchü systems,ü suchü asü variationsü ofü Threadü Pool [Schmidt],üThreadüSpecificüStorageü[Schmidt],üProxyü[Gamma],üCommandü[Gamma], Stateü[Gamma],üandüActiveüObjectü[Schmidt]. Inüthisüsection,üweüwillüillustrateütheüuseüofütheüframework,üspecificallyürelatedüto theü Activeü Objectü pattern.ü Noteü thatü theü Activeü Objectü patternsü asü describedü in [Schmidt]üisüconcernedüonlyüwithünon-distributedüconcurrentüprogramming.üSinceüwe specificallyü targetü distributedü concurrentüprogramming,ümanyü ofü theü patternsü weüuse (includingütheüoneüweüillustrateühere)üareüvariationsüofü“offütheüshelf”üpatterns. TheüActiveüObjectüpatternüessentiallyüallowsüanüobjectütoüexecuteüaümethodüinüaüdifferentü threadü thanü theü oneü thatü invokedü theü method.ü Thisü isü achievedü byü givingü the activeüobjectüanüactivationüqueueüthatüstoresüpendingüinvocations,üandübyüsupplyingüthe activeüobjectüwithüaüthreadüofüitsüown,üthatücontinuouslyüretrievesüanüinvocationüfrom theüactivationüqueueüaccordingütoüsomeüsynchronizationüconstraints,üandüexecutesüits associatedümethod. Inüorderütoücreateüanüactiveüobjectüinüourüframework,ütheüuserühasütoügoüthroughüthe followingüstepsü(essentiallyüdictatedübyütheüpattern): 1. Forü eachümethodüXüinütheü activeüobject’süinterface,ü createüaüclassüsoüthatümethod objectsü thatü representsü theü invocationsü onü Xü canü beü instantiatedü fromü it.ü Each methodüobjectücontainsütheüparametersüofütheüinvocation. 2. Aümethodücallüonüanotherüobjectüisüimplementedübyücreatingüanüinstanceüofütheücorrespondingümethodüclassüandüputtingüitüinütheüdestinationüobject’süactivationüqueue. Itüisütheüclient’süresponsibilityütoüperformütheseüsteps. 3. UnlikeüSchmidt’süActiveüObjectüpattern,üwhereüsynchronizationücodeüspecicütoüan activeü objectü hasü toü beü incorporatedü inü theü activeü object’sü dedicatedü scheduler object,üourüactiveüobjectüpatternüusesüaügenericüSchedulerüobjectüthatüdefersütheütestingüofütheüpreconditionü(guard)ütoütheümethodüobjects.üOfücourse,ütheüspecicüsynchronizationücodeüstillühasütoübeüwritten. Weübelieveüthatüactiveüobjectsüareükeyüabstractionsüinüaüconcurrent,üobjectüoriented environment.üHowever,ütheüprocessüofüdefiningüactiveüobjectsüasüdescribedüaboveügets tediousü whenü theü applicationü programü usesü moreü thanü justü aü fewü activeü classesü and methods.üInütheünextüsection,üweüshowühowülanguageüfeaturesücanübeüusedütoüalleviate theüproblemüweühaveüillustratedüinüthisüsection.
3.üIntroducingütheüCORRELATEüLanguage CORRELATEü isütheülanguageüweüuseütoüexploitüourüobjectüsupportüsystem.üThis languageü emergedü asü aü naturalü successorü toü ourü earlyü purelyü framework-based approach.üKeyüabstractionsüfromütheüframeworkü(suchüasüactiveüobjects)üareüpresentüin theülanguage,üwhereütheyücanübeümanipulatedüandüusedüatüaühigherülevel. CORRELATEüisüaüclass-basedüconcurrentüobject-orientedülanguage.üWhileüCORRELATEülooksüaülotülikeüC++,üitsücomputationalümodel,üunlikeüthatüofüC++,üisübased onü concurrentü objects.ü Dueü toü spaceü constraints,ü weü don’tü coverü CORRELATEü featuresüsuchüasüautonomousümethodsüorüsynchronization,übutüinsteadüweüfocusüsolelyüon
supportü forü activeü objects.ü Weü referütoü [Joosen]ü forü aü moreü elaborateü CORRELATE overview. Aü CORRELATEü applicationü consistsü of activeü objectsü thatü interactü byü sendingü messagesü (invokingü operations).ü CORRELATE supportsü bothü synchronousü andü asynchronous messageü passing.ü Becauseü weü believeü that activeüobjectsüareükeyüabstractionsüinüaüconcurrent,ü objectü orientedü environmentü (exactlyü theü environmentü targetedü byü CORRELATE),üactiveüobjectsüareüavailableüatütheülanguageülevel.üTheüdeclarationüofüanüactive classüinüCORRELATEülooksülikeütheücodeüexampleütoütheüright. Anüimmediateübenefitüisüthatüthisüformümakesüitümuchüeasierüforüanüapplicationüprogrammerütoüactuallyüuseüactiveüobjects.üInütheüCORRELATEürun-time,üweüstillüuseüthe Activeü Objectü patternü toü implementü theseü activeü objects.ü Theü run-timeü containsü the “fixedüparticipants”üofütheüpattern,ünotablyüActivationüQueueüandüScheduler,üwhileüthe “variableüparts”üofütheüpatternü(suchüasütheüvariousümethodüobjectsüandütheüsynchronizationücode)üareüautomaticallyügeneratedüfromütheüaboveüCORRELATEücode. Atü theü client’sü side,ü invocationsü onü active objectsü noü longerü requireü creatingü method objects.ü Theü applicationüprogrammerücanüsimplyüwriteücodeülikeütheüfragmentüonütheürightüfor anüasynchronousüinvocationüofüMethod1üonü_my_server,üusingüxüasüparameter.üThisüis automaticallyütranslatedüinütheücreationüofüaümethodüobject,üasüinütheüpreviousüsection. ThanksütoütheülocationütransparencyüofferedübyüCORRELATE,ütheümethodüobjectüautomaticallyüreachesütheüdestinationüactiveüobject,üwhereüitüisüputüinütheülatter’süactivation queue. CORRELATEüprogramsüareüthusütranslatedüintoüanüinstantiationüofütheüunderlying supportü framework.ü Theü resultü isü thatü programmersü programmingü inü CORRELATE neverüuseütheübasicüabstractionsüofüourüframeworküdirectly.üTheyüevenüaren’tüawareüof theüframework,üandüdon’tüneedütoüknowüitsüinterface.üAsüfarüasütheüCORRELATEüprogrammersüareüconcerned,ütheülanguageüwithüitsüconcurrentüobjectsüisütheirüAPI.
4.üReopeningütheüSystem Oneü problemü withü automaticallyü generatingü anü instantiationü ofü aü frameworkü by translatingü CORRELATEü code,ü isü theü dangerü ofü losingü theü openü architectureü ofü the framework.üIndeed,üprogrammersüdon’tüevenügetütoüseeütheüframeworküinütheüapplication.üToüsolveüthisüproblem,üweüexposeütheüimportantüabstractionsüofütheüframeworküby introducingü themüasü concurrentü objectsüinü theüCORRELATEülanguage.ü Theüresultü is that,üwhileüinügeneralüCORRELATEüprogrammersüareünotüawareüofüallütheüabstractions ofütheüframework,ütheyüareüexplicitlyüawareüofütheüimportantüones,übecauseütheseüare availableüasüobjectsüwithüwhichütheyücanüinteractüandüwhoseübehaviourütheyücanüalter. TwoüsuchüimportantüabstractionsüareütheüSchedulerüandütheüActivationüQueueü(both participantsü ofü theü patternü describedü inü sectionü 2).ü Togetherü withü aü numberü ofü other importantüaspectsüofütheüunderlyingürun-timeüsystem,ütheyüareüavailableüinütheüCORRELATEü languageü asü MetaObjectü objects.ü Inü CORRELATE,ü eachü objectü canü haveü its
ownüindividualümetaobject.üAümetaobjectüisüresponsibleüforücreationüandüdestructionüof itsübase-levelüobject,üforümanagingütheüactivationüqueue,üforüdeterminingüwhichümethod willübeüexecuted,üandüforüforwardingüinvocations.üEachümetaobjectücanübeüspecialized inütheüCORRELATEülanguage. Usingü thisü approach,ü weü notü onlyü obtainü anü openü environment,ü butü weü canü very explicitlyücontrolütheüdegreeüofüopenness,übyüidentifyingütheücomponentsüweüwantüto expose.üInüourüActiveüObjectüpatternüexample,üweüonlyüexposeüpartüofütheüparticipants, namelyütheüactivationüqueueüandütheüscheduler. Anotherü exampleü ofü thisü approachü isü theü RoutingProtocolü classü inü theü I/Oü subframeworkü ofü ourü system.ü Thisü classü encapsulatesü theü protocolü thatü determinesü the routingütablesüthatüareüusedütoürouteütheüinvocationümessagesütoütheirüdestination.üThe applicationüprogrammerücanücustomizeüthisüprotocolütoücreateüaüroutingüprotocolüthatüis optimisedüforüaüspecificüapplicationü[Matthijs].
5.üDiscussion Aütrivialüadvantageüofüourüapproachüisüthatüitübecomesümuchüeasierüforüanüapplicationüprogrammerütoüuseüourüframework.üTheüprogrammerücanüconcentrateüonütheüdifficultiesü ofü theü applicationü domain,ü withoutü havingü toü rememberü howü toü useü the framework. Aü secondü advantageü isü thatü theü languageü levelü interfaceü canü remainü stableü even whileütheüunderlyingüframeworksüevolve.üThisüisümainlyüanüadvantageüinüenvironments suchüasüoursüwhereütheüframeworksüthemselvesüareüsubjectütoüstudy,üwhichüsometimes resultsüinüchangesütoüinterfacesüandüfunctionality. Aüpotentialüproblemüwithütheüapproachüisüthat,übyüexposingümoreüandümoreücomponentsüatütheülanguageülevel,üweümayüendüupüwithüaücomplexümeta-levelüframework:üthe baseülevelüframeworküisüconvenientlyühidden,übutüallüappealingüobjectsüareüexposedüat theülanguageülevel,üandütheyüthemselvesüinteractüandümayüformüaüframeworküofütheir own.üOurüexperienceüshowsüthatütheüframeworküatüthisülevelüwillünotübeüasücomplexüas theüoriginalüone,übutütheüaspectsüandüimplicationsüofüthisüapproachüareücertainlyüsubject toüfurtherüstudy.
6.üReferences [Bijnens] Stijnü Bijnens,ü Wouterü Joosen,ü andü Pierreü Verbaeten.ü Aü Reflectiveü Invocation SchemeütoüRealiseüAdvancedüObjectüManagement.üInüObject-BasedüDistributedüProgramming,üLectureüNotesüinüComputerüScienceü791,ü1994. [Gamma] ErichüGamma,üRichardüHelm,üRalphüJohnson,üJohnüVlissidesüDesignüPatterns,üElementsüofüReusableüObject-OrientedüSoftware.üAddisonüWesley,ü1994. [Johnson] Ralphü Johnson.ü Documentingü Frameworksü usingü Patterns.ü Inü Proceedingsü of OOPSLAü‘92. [Joosen] WouterüJoosen,üBertüRobben,üJohanüVanüOeyen,üFranküMatthijs,üStijnüBijnensüand Pierreü Verbaeten.ü Developingü Distributedü Applicationsü usingü theü CORRELATE MOP.üDept.üofüComp.üScience,üKULeuvenüBelgium,ütechnicalüreport. [Matthijs] FranküMatthijs,üYolandeü Berbers,üWouterü Joosen,üJohanüVanüOeyen,üBertüRobben andüPierreüVerbaeten.üTowardsüflexibleüI/Oüsypportüinüparallelüandüdistributedüsystems.üInüProceedingsüofüPDCSü‘96. [Schmidt] DouglasüSchmidt.üDesignüPatternsüforüConcurrent,üParallel,üandüDistributedüSystems. http://www.cs.wustl.edu/~schmidt/patterns-cpd.html
ToolüSupportüfor Framework-SpecicüLanguageüExtensions ElizabethüBjarnasonüandüGšrelüHedin DeptüofüComputerüScience,üLundüUniversity Boxü118,üSE-221ü00üLund,üSweden e-mail:ü{Elizabeth.Bjarnasonü|üGorel.Hedin}@dna.lth.se
Abstract.ü Theü conventionsü connectedü toü theü useü ofü object-oriented frameworksü canü beü describedü byü framework-specicü languageü extensions.üTheüprogrammerüisüthenüaidedüinüwritingümoreücorrectüprograms. Inü anü integratedü structure-orientedü language-designü environmentü such languageüextensionsücanübeüsupportedüinternally.
1
Introduction
Whiteü boxü frameworksü areü knownü forü beingü hardü toü useü sinceü theyü requireü detailed knowledgeüofütheüinternalüstructureüofütheüframework[Joh88],üandüthatüaünumberüofüprogrammingüconventions[Hed97]ümustübeüadheredütoüwhenüusingütheüframework.üFailure toüfollowütheseüconventionsümayüleadütoüunpredictableüerrorsüwhichüareüoftenüleftüundetectedü untilü run-time.ü Framework-specicü languageü extensionsü whichü captureü these conventionsüallowü suchüerrorsütoübeüdetectedüandüreportedütoütheüprogrammerü before theüprogramüisüexecuted.üThisüisüespeciallyüusefulüwhenüworkingüinüanüintegratedüprogrammingü environmentü sinceü editingü supportü forü theü framework-specicü syntaxü and semanticsücanüthenübeüsupplied.üAlso,üinüsuchüanüenvironmentüdebuggingücanübeüsupportedüinütermsüofütheüextendedülanguageüratherüthanüinütermsüofütheüinternalücodeüofüthe framework.üTheüdesignüandüimplementationüofüframework-specicüextensionsücanübe madeüeasierübyüsupplyingüsupportüforüsuchülanguageüextensionsüinüanüintegratedüstructure-orientedü language-designü environment.ü Theü syntax,ü static-semantics,ü andü code generationüforütheülanguageüextensionsüareüthenüdenedüinütermsüofüaübaseülanguage. Theü proposedü techniquesü forü handlingü suchü languageü extensionsü areü intendedü toü be usedüinüourülanguage-designüenvironment,üAPPLABü[Bja96,üBHN97],ütoüsupportüthe interactiveüdesign,üdevelopmentüandüuseüofüframework-specicülanguageüextensions. APPLABücurrentlyüsupportsütheüinteractiveüdevelopmentüofülanguages.üAülanguage canübeüdesignedübyüeditingüaügrammarüdescription,üandüanüexampleüprogramücanüsimultaneouslyübeüeditedüinütheünewü(changing)ülanguage.üTheüeditorüused,übothüforügrammarsüandüprograms,üisüstructure-orientedüandübasedüonügrammarüinterpretation.üThatüis, itü interpretsü theü currentü grammarü descriptionsü inü orderü toü supplyü language-specic behaviourütoütheüprogramüeditor.üEditingüisüperformedüonütheüabstractüsyntaxütreesüof theüprograms,üandünotüatütheütextülevel.üTextüeditingüofüsubtreesüisüsupportedübyüinvokingü aü grammar-interpretingü parser.ü Theü static-semanticsü andü codeü generationü is expressedübyüstandardüAGsüusingüanüobject-orientedüspecicationülanguage.
2
SupportüforüLanguageüExtensions
Figureü1üshowsühowütheügrammarüforüaübaseülanguage,üG BL,üisüextendedüforüaüframework,üFW.üTheüframeworküisüprogrammedüinütheübaseülanguage,üwhereasütheüapplicationüprogramüAPüisüprogrammedüinütheüextendedülanguageüG BL+FW.üTheügrammarüfor theüextensions,üGFW,ücanüaccessütheüframeworkütoüimplementütheücodeügenerationüofüthe newülanguageüconstructs.üBecauseütheüextendedülanguageüimportsütheübaseülanguage, ratherüthanücopyingüitsüdenition,üchangesümadeütoütheübaseülanguageücanübeüautomaticallyüincorporatedüintoütheüextendedülanguage.üSuchüchangesüofütheübaseülanguageümay beüfairlyüfrequentüinüanüinteractiveülanguage-designüenvironmentüsuchüasüAPPLAB.
GBL Extends GFW
Programmedüin FW Accesses
Programmedüin
Grammar Program
AP
Figureü 1. Theü dependenciesü betweenü theü languageü descriptionsü ofü theü baseü language,üGBL andüofütheüframework-specicülanguageüextensions,üG FW,ütheüframework, FW,üandüanüapplicationüprogram,üAP,üexpressedüinütheüextendedülanguage,üG BL+FW.
2.1
SubclassingüExistingüLanguageüConstructs
Whenüextendingüaülanguageüwithünewüconstructsüitüisüdesirableütoüreuseüasümuchüasüpossibleü ofütheüexistingüimplementation,ü asüwellüasübeingü ableütoüaddünewüfeatures.ü Inüa declarativeüsystemüusingüanüobject-orientedügrammarünotationüthisücanübeüdoneübyüsubclassingü existingü grammarü rules.ü Theü newü languageü constructü thenü inheritsü the attributesüandürulesüofütheüinheritedügrammarüspecication.üNewüfeaturesücanübeüadded byü deningü additionalü attributes,ü andü existingü featuresü canü beü modiedü byü reimplementingütheüexistingürulesüinütheügrammarüspecicationüofütheünewülanguageüconstruct. Considerü anü exampleü takenü fromü robotü programmingü whereü aü baseü languageü is extendedübyüaddingüaüconstructüforümovingütheürobotüarm.üTheünewüconstruct, MoveTo, isüdeclaredüasüaüsubclassüofütheüexisting Statementüdeclaration.üPartüofütheüspecication ofütheüextendedülanguage,GROBOT,üisüasüfollows: MoveTo::=Statementü(ü“move”ü“to”üExp) (*üStatementüforümovingütheürobotüarm.ü*) constructüinütermsüofütheüframeworkü*) (*üstaticüsemantics:
};
(1)
(3)
(*ücodeügeneration: (4) üwhichücomputeütheücodeütoügenerateübyüusingütheüexpansionütree*)
Theüabstractüandüconcreteüsyntaxü(1)üareüspecied,üintroducingütheünewükeywords move and to,üandüstatingüthatüa MoveTo-statementücontainsüanExp-part.üStatic-semanticürules thatüensureüthatütheüexpressionü( Exp)ürepresentsüaücoordinateüareüaddedü(3).üTheücode generationü forü theMoveTo-constructü (4)üinvolvesü generatingü aü callü toü theü framework usingütheüdenedüexpansionütreeü(2). 2.2
ExpansionüTrees
Aüprogrammerüusingü anü extendedü languageüisü onlyüinterestedüinü seeingü theünewülanguageüconstructsüandü theirüsyntax.ü Theüsystem,üonü theüotherühand,üneedsütoüconsider howütheünewüconstructsüareüimplementedüinütermsüofütheübaseülanguageüandütheüframework,üinüorderütoücorrectlyüperformücodeügenerationüandüstatic-semanticüchecking.üInüa systemü whoseü internalü representationü ofü programsü isü basedü onü abstractü syntaxü trees, ASTs, expansionütreesücanübeüusedüforürepresentingütheünewülanguageüconstructs.üSimilarlyütoü macrosüwhichüareü notü expandedü untilücompileü time,ü expansionü treesü areünot constructedü untilü anü attributedü syntaxü treeü isü evaluated.ü Thisü canü beü doneü byü using Higher-Orderü Attributeü Grammars[VSK89]ü whichü allowü aü nodeü inü theü treeü toü be denedübyütheüvalueüofüanüattribute.üWeüwantüsuchünodesütoübeüinvisibleütoütheüuser,übut usedübyütheüsystemütoüperformüattributeüevaluation,üandüthusücodeügenerationüandüstaticsemanticüchecking.üSinceütheüstructureüofüanüexpansionütreeüfollowsütheübaseülanguage theüsystemücanüevaluateüitsüattributesüinütheüsameüwayüasüforütheüotherüpartsüofütheüprogramütree. Partü ofütheü ASTü forü aü programü usingü theüextendedü language GROBOT ü isü shownü in Figureü2.üTheüexpansionütreeüconnectedütoüthe MoveTo-nodeücontainsüaüprocedureücall ofüthe MoveLinear-methodüofütheüframework.üNote,üthatüaüreferenceübacküintoütheüprogramüASTüisüusedütoüaccessütheüuser-denedücoordinates,üwhileütheüotherücoordinates areüdenedübyütheülanguageüextension. GBL+ROBOT üProgram MoveTo ProcCall
“MoveLinear”
CoordExp x
y
z
ActPars
Figureü2. Partüofütheüabstractüsyntaxütreeüforüaüprogramüexpressedüinütheüextended languageüGBL+ROBOT.
3
ConclusionsüandüFutureüWork
Framework-specicülanguageüextensionsüwhichüsupplyüframework-specicüsyntaxüand enforceütheüconventionsüofü theüframeworkümakeüitüsaferüandüeasierütoüuseüobject-orientedü frameworks.ü Anü object-orientedü grammarü notationü allowsü newü languageü constructsü toü beü addedü byü subclassingü existingü grammarü rules.ü Theü newü constructsü can eitherü reuseü theü properties,ü likeü syntaxü andü semantics,ü ofü theü existingü languageü constructs,üorüspecifyünewüsyntax,üsemanticsüetc..üWhenüworkingüinüaüprogrammingüenvironmentüwhichürepresentsüprogramsüasüabstractüsyntaxütrees, expansionütrees,übasedüon higher-orderüattributeügrammars,ücanübeüusedütoüimplementünewülanguageüconstructsüin termsüofüaüframework.üStatic-semanticücheckingüandücodeügeneration,üasüwellüasüsource codeüdebugging,ücanüthenübeüsuppliedüforütheüextendedülanguage.üSuchüsupportüforüthe designüandüimplementationüofüframework-specicülanguageüextensionsüisübeingüadded toüourülanguage-designüenvironment,üAPPLAB. Thereüareüseveralüinterestingüissuesütoülooküintoüconnectedütoütheüuseüandüimplementationüofüframework-specicülanguageüextensions.üForüexample,üwhenüaübaseülanguage isüchangedüthisüaffectsülanguagesüimplementedüasüanüextensionüofüthatübaseülanguage, andü programsü expressedü inü theü changedü language.ü Aü mechanismü isü thenü neededü for transformingütheüaffectedülanguagesüandüprogramsüintoüconsistentüversionsüaccording toütheünewüversionüofütheübaseülanguage,übyüforüexampleüusingütechniquesülikeüthoseüin theü TransformGenüsystemü [GKL94].ü Itü isü alsoüdesirableü toü beü ableü toüallowü multiple languageü extensions.ü Thatü is,ü toü combineü severalü languageü extensionsü intoü one extendedü language.ü Thereü mayü thenü beü combinationsü ofü languageü constructsü which contradictüeachüother.üCanüsuchüclashesübeüavoidedüorüresolvedüautomatically? Aülotüofüworküremainsütoübeüdoneüinüthisüarea.üBothüinüimplementingütheüproposed techniquesüandüinüdoingüfurtherüresearchüintoütheüarea.üDueütoüitsüdeclarativeünatureüwe believeüAPPLABüisüaüsuitableüplatformüforüperformingüsuchüresearch,üandütryingüout newüideasüinüpractice.
4
References
[BHN97] [Bja96] [GKL94] [Hed97] [Joh88] [VSK89]
E.üBjarnason,üG.üHedinüandüK.üNilsson.üAPPLAB-AnüApplicationüLanguage Laboratory.üTechnüReport,üDept.üComputerüScience,üLundüUniversity,ü1997. E.üBjarnason.üAPPLAB:üUser’süGuideü(versionü1.2).üTechn.üReportüLU-CSIR:96-01,üDepartmentüofüComputerüScience,üLundüUniversity,ü1996. D.üGarlan,üC. W.üKrueger,üandüB. StaudtüLerner.üTransformGen:üAutomating theü Maintenanceü ofü Structure-Orientedü Environments.ACMü TOPLAS, 16(3):727–774,üMayü1994. G.ü Hedin.ü Attributeü Extensionü -ü Aü Techniqueü forü Enforcingü Programming Conventions. NordicüJournalüofüComputing ü4(1997),ü93-122.ü1997. R.üE.üJohnssonüandüB.üFoote.üDesigningüReusableüClasses. JournalüofüObjectOrientedüProgramming,ü1(2):22-35,üJune/Julyü1988. H.ü H.ü Vogt,ü S.ü D.ü Swierstraü andü M.ü F.ü Kuiper.ü Higherü Orderü Attribute Grammars. Proceedingsü ofü theü ACMü SIGPLANü ‘89ü Conferenceü on ProgrammingüLanguageüDesignüandüImplementation ,üACMüSigplanüNotices, 24(7),ü1989.
LanguageüSupportüforüDesignüPatterns UsingüAttributeüExtension GšrelüHedin Dept.üofüComputerüScience,üLundüUniversity Boxü118,üS-221ü00üLund,üSweden [email protected] Abstract Thisüpaperüpresentsüaütechniqueübasedüonüattributeügrammarsüforüformalizingüdesignüpatternüsolutions.üTheütechniqueüallowsüdesignüpatternüapplicationsütoübeüidentiedüinütheüsourceücode,üandüsupportsüautomaticücheckingüthat theüpatternüisüappliedücorrectly.üWeüexpectütheütechniqueütoübeüparticularlyüuseful whenüspecializingüframeworksübuiltüusingüdesignüpatterns.
1
Introduction
Designü patternsü inü catalogsü likeü [Gammaü etü al.ü 1994]ü andü [Buschmannü etü al.ü 1996] describeürecurringüstructuresüofücollaboratingüobjects.üEachüpatternüinvolvesüaünumber ofüparticipatingüobjectsüplayingüdifferentürolesüinütheüpattern.üAlthoughütheüdesignüpatternüsolutionsüareübasedüonüsemi-formalüclassüdiagramsüwhichüallowüforümanyüimplementationüvariations,ü theyüareüsufcientlyüpreciseü soüthatüwhenüselectingü aüparticular implementation,ütheüpatternücanübeüformalizedüandüformütheübasisüofüprogrammingülanguageüsupport. Whenüaüdesignüpatternüisüapplied,üthisücanübeüviewedüasüaüintroducingüaünumberüof rules,üi.e.üsubsequentüupdatesütoütheüprogramüshouldübeüdoneüwithoutübreakingütheürules ofütheüpattern.üForüexample,ütheüDecoratorüpatternüusesüaücleverüwayüofüaddingüfunctionalityütoüComponentüobjects:üaüDecoratorüobjectü“wraps”üaüComponent,üi.e.,üallüclientsü ofü theü Componentü referü toü theü wrappingü Decoratorü insteadü ofü directlyü toü the Component.üTheüDecoratorüforwardsüallümessagesütoüitsüComponentüinüadditionütoüpossiblyüaddingüsomeübehaviorüofüitsüown.üAnüapplicationüofütheüDecoratorüpatternüimplies someürules,üforüexampleüthatüwheneverüaünewüoperationüinüintroducedüonüComponents, eachüDecoratorümustüimplementüthisüoperationüandüforwardüitütoüitsüComponent. Thus,üweücanüthinküofüaüpatternüapplicationüasüaükindüofülanguageüconstructüwhich identiesütheüobjectsüthatüplayütheüparticularürolesüinütheüpattern,üandüwhichüspecies someürulesüthatütheseüobjectsümustüfollow. Patternsüareüevolvingüconcepts.üNewüpatternsüandüvariationsüonühowütoüimplement specicüpatternsüareüreportedüeveryüyearüatüconferences,üinübooksüandüjournals,üandüin discussionügroupsüonütheünet.üForüthisüreason,üitüisünotüsufcientütoüsupportüaünumberüof predenedü patternsü byü built-inü languageü constructs.ü Instead,ü weü needü aü mechanism whichüallowsünewüpatternsütoübeübothüspeciedüandüapplied.üI.e.,üifüweüviewüeachüpatternüasüaülanguageüconstruct,üweüneedüaümechanismüforüextendingütheülanguage.
Inüthisüpaper,üweüproposeütheüuseüof attributeüextensionü[Hedinü1997üa]ütoüsupport theü specicationü andü applicationü ofü designü patterns.ü Attributeü extensionü allowsü the static-semanticsüofüaülanguageütoübeüextended,üallowingüprogrammingüconventionsüto beüenforced,übutükeepsütheüsyntaxüofütheübaseülanguage.üAükeyüadvantageüofüthisütechniqueüisüthatüitüisüeasyütoüintegrateüwithüexistingülanguagesüandüenvironments. Attributeü extensionü isü basedü onü attributeü grammars,ü describingü conventionsü by declarativeüsemanticürules.üAüconventionücheckerücanübeüautomaticallyügeneratedüfrom anüextensionügrammarüinüaüsimilarüwayüasüanüattributeüevaluatorücanübeügeneratedüfrom anüattributeügrammar.ü Theü techniqueümakesüuseüofü threeükindsüofü specication:ü 1)üA baseü grammarü interface,ü whichü isü aü context-freeü grammarü forü theü baseü language, extendedüwithüfunctionsüforübasicüstatic-semanticüinformationüsuchüasünameübindings andü typeü information.ü 2)ü Anextensionü grammar,ü whichü isü anü attributeü grammar describingütheüprogrammingüconventions,ümakingüuseüofütheübaseügrammarüinterfaceüto avoidüspecifyingübasicüinformationüfromüscratch.ü3) Attributeücomments,üwhichüareüspecialücommentsüusedütoüannotateüanüapplicationüprogram. Inütheü followingüweügiveü anü overviewüoverühowütheüattributeüextensionütechnique canübeüusedütoüformalizeüdesignüpatternüsolutions.üForüaüdetailedüexampleüandüaümore thoroughü discussionü ofü theü technique,ü theü readerü isü referredü toü theü fullü paperü [Hedin 1997üb].
2
Languageüsupportüforüaüpattern
Toüsupportüaüpatternüatütheülanguageülevel,üweüneedürstüofüallütoüidentifyütheüdifferent rolesüinütheüpatternüandüthenütoüformulateütheürulesüforütheseüpatternüroles. 2.1
Patternüroles
Theümostüimportantürolesüareüplayedübyüclasses,übutüsomeürolesümayüalsoübeüplayedüby methodsüorüvariables.üForüexample,üinütheüDecoratorüpatternü[Gammaüetüal.ü1994],üwe canü identifyü theü followingü roles: OMPONENT C (class), OPERATIONü (method), CONCRETECOMPONENT ü (class), DECORATORü (class), DECORATEDCOMPONENTü (variable), CONCRETEDECORATORü(class), DECORATINGIMPLEMENTATIONü(method). Toüsupportütheüidenticationüofüaüpatternüinütheüsourceücode,üweüannotateütheüsource codeüwithüpatternüroles,üusingüattributeücomments.üHowever,üitüisünotünecessaryütoümark allütheürolesüinütheüsourceüprogram,übecauseümanyüofütheürolesücanübeüderivedüfromüthe otherüroles.üForütheüdecorator,üitüisüsufcientütoüexplicitlyümarküthe OMPONENT C , DECORATOR,ü and DECORATEDCOMPONENTü roles.ü Weü callü theseü rolesü the deningü roles. Otherürolesüareücalledderivedüroles.üItüisüpossibleütoüformalizeütheüpatternüusingümore orüfewerüdeningüroles,übutütooüfewüdeningürolesümayügiveüaütooürestrictiveüimplementationü(forüexampleürelyingüonünamingüconventionsüofüclasses),üandütooümanyüdening rolesü mayü putü anü unnecessaryü burdenü onü theü programmerü toü explicitlyü identifyü the roles. Patternüapplicationsüoftenücrossümoduleüboundaries.üInüparticular,üitüisücommonüthat aüframeworküimplementsüsomeüofütheürolesüinüaüpatternüapplicationüandüthatütheüapplica-
tionüprogramüusingütheüframeworküsuppliesütheüotherüroles.üForüexample,üthe OMPOC NENTüandüthe D ECORATORümayübeüpartüofüaüwindow-systemüframework,üwhereasüthe CONCRETECOMPONENTSüandüthe CONCRETEDECORATORSümayübeüpartü ofüanüapplicationüusingütheüframework.üWeüexpectülanguageüsupportüforüdesignüpatternsütoübeüparticularlyübenecialüforüframeworksüsinceüitüallowsürulesüforühowütoüuseütheüframeworküto beüformalizedüandücheckedüautomatically. 2.2
Patternürules
Theü rulesü forü applyingü aü patternü canü beü expressedü inü termsü ofü theü patternü roles.üThe identiedü rolesü mustü beü consistentü withü eachü other.ü Weü referü toü rulesü whichü express suchüconsistencyüasroleürules.üForüexample,üinüourüformalizationüofütheüDecoratorüpatternüweüwillühaveüaüroleüruleüstatingüthatüa ECORATOR D ümustübeüaüsubclassüofüa OMPOC NENT. Ifü theü roleü rulesü areü satised,ü theü patternü applicationü isü sufcientlyü completeü to makeüitüpossibleütoügoüonüwithüchecking collaborationürules.üForüexample,ütoüformalize theüDecoratorüpatternüweücouldühaveüaücollaborationüruleüstatingüthatüa ONCRETE C DECORATORümustühaveü a E DCORATINGIMPLEMENTATIONüforüeach OPERATIONüdeclaredü in the COMPONENT.üThe DECORATINGIMPLEMENTATIONümayübeüdeclaredüinONCRETEC DECORATORüorüinüanyüofüitsüsuperclasses. Theücollaborationürulesüareüusuallyümoreüinterestingüthanütheüroleürulesüinüthatüthey areü moreü easilyü brokenü byü mistake,ü andü thereforeü moreü interestingü toü enforce.ü For example,üifüweüareüworkingüwithüaüwindowüsystemüapplyingütheüDecoratorüpattern,üitüis easyütoüforgetütoüupdateütheONCRETE C DECORATORüclassesüwithüdelegatingüoperations eachütimeüaünew POERATIONüinüthe COMPONENTüisüadded.üThisüerrorümightünotüshowüup immediately,üsinceüapplicationsüwhichüdoünotümakeüuseüofütheüdecoratingüobjectsüwill worküne.üAüsystemüwhichüenforcesütheüpatternürulesüwouldüdetectüsuchüerrorsüatücompile-time. 2.3
Specifyingüaüpattern
Toü specifyü theü rolesü andü rulesü forü aü pattern,ü anü extensionü grammarü isü writtenü which extendsütheübaseügrammarüinterfaceüwithüattributeüdeclarationsüandüequationsüdening theü attributeü values.ü Forü eachü deningü role,ü aü specialü “program-dened”ü attributeü is declared,ü whoseü defaultü denitionü canü beü overriddenü byü anü attributeü comment.ü A derivedüroleüisürepresentedübyüaüsynthesizedüattribute.üFinally,ütheüroleürulesüandücollaborationürulesüareürepresentedübyüspecialüstring-valuedü“error”üattributes.üTheüvalueüof anüerrorüattributeüisüdenedüasüanüerrorümessageüifütheüruleüisüviolated,üandütheüempty stringüifütheüruleüisüsatised.üToüallowütheüdenitionüofütheseüattributes,üadditionalüsynthesizedüandüinheritedüattributesümayübeüintroduced.
3
Conclusion
Theülanguageüsupportüforüdesignüpatternsüweühaveüoutlinedühereüsupportsübothütheüidenticationüofüpatternsüinüsourceücodeü(traceability),üandüautomaticücheckabilityüthatüthe patternsüareüappliedüconsistently,üaccordingütoügivenürules.üTheütechniqueürequiresüthat theüprogrammerüannotatesütheüsourceücodeüwithüsomeüdeningüpatternüroles. Theüuseüofüformalizedüpatternsünaturallyühasüaücostüinüexibility:üAnyüpatternüformalizationüwillüpinüdownüpreciseürulesüforütheüpattern,üandüitümightübeüdifcultütoüforeseeü allü reasonableü implementationü variationsü ofü theü pattern.ü However,ü justü as standardizedülibrariesüandüframeworksüareüdevelopedüforüaügivenüimplementationülanguage,üweüexpectüstandardizedüpatternüspecicationsütoübeüdevelopedüforüaügivenülanguage. Weüexpectüoneüofütheümostübenecialüusesüofüformalizedüpatternsütoübeüforüframeworksüwhereütheüframeworküsuppliesüsomeüroles,üandütheüapplicationüprogramütheüother roles.üItüisüthenüveryüimportantüthatütheüapplicationüprogramüfollowsütheüpatternürules, becauseüotherwiseütheücompleteüsystemümayüfail.üItüisüwellüknownüthatüframeworksüare difcultütoüuseüandüthatüapplicationüprogrammersüneedütoühaveüdetailedüknowledgeüof theüframeworküimplementationüinüorderütoübeüableütoüuseüitücorrectly.üAnüaidüinüsolving thisüproblemücouldübeütoüformulateütheürequirementsüonüusingütheüframeworküinüterms ofüpatterns,üandütoüformalizeüandüenforceütheseüpatternürulesüasüdiscussedüinüthisüpaper.
References [Buschmannüetüal.ü1996] Buschmann,ü F.,ü Meunier,ü R.,ü Rohnert,ü H.,ü Sommerlad,ü P.,ü andü Stal,ü M. Pattern-OrientedüSoftwareüArchitecture.üAüSystemüofüPatterns .üWiley.ü1996. [Gammaüetüal.ü1994] Gamma,ü E.,ü Helm,ü R.,ü Johnson,ü R.,ü andü Vlissides,üDesignü J. Patterns. ElementsüofüReusableüObject-OrientedüSoftware ,üAddison-Wesley,ü1994. [Hedinü1997üa] Hedin,ü G.ü Attributeü Extensionü -ü aü Techniqueü forü Enforcingü Programming Conventions. NordicüJournalüofüComputing ü4ü(1997),ü93-122. [Hedinü1997üb] Hedin,üG.üLanguageüSupportüforüDesignüPatternsüusingüAttributeüExtension.üIn Proceedingsü ofü LSDF’97, Workshopü onü Languageü Supportü forü Design Patternsü andü Frameworks,ü heldü inü connectionü toü ECOOP’97.ü Fullü paper availableüelectronicallyüathttp://www.ide.hk-r.se/~bosch/lsdf/.
FormalüDefinitionüandüRefinementüof UML’süModule/PackageüConcept AndyüSchŸrr,üAndreasüJ.üWinter LehrstuhlüfŸrüInformatiküIII,üRWTHüAachen,üD-52056üAachen [andy|winter]@i3.informatik.rwth-aachen.de
Abstract. UMLüisütheüfirstüOOümodelingülanguageüwithüaüusefulümodularizationüand informationühidingüconceptüwhichüsupportsünesting,üimport,üandürefinement.üThisüpaper translatesüUML’süinformalüpackageüdefinitionüintoüpredicateülogicüformulasüandüsolves someüopenüproblemsüconcerningütheüvisibilityüofüexportedüandüimportedüelements.
1 Introduction Afterüaboutü20üyearsüofüdevelopment,üobject-orientedü(OO)ümodelingümethodsüandünotationsüareüwidelyüacceptedüforütheüanalysisüandüdesignüofüsoftwareüsystems.üPopularüOO methodsü-ülikeüBoochü[1],üOMTü[9],üorüOOSEü[4]ü-üareüusedütoüdevelopüsystemsüofücontinuouslyüincreasingüsizeüandücomplexity.üKeepingüanalysisüandüdesignüdocumentsüconsistentüorüreusingügenericüpartsüisüaünightmareüwithoutüanyümoduleüconcept. Theseüproblemsüareüfamiliarüforü softwareüdevelopersüofütheülateü60ies.üWell-known softwareü engineeringü conceptsü likeü “abstractü dataü types”ü andü “programming-in-thelarge”ühaveübeenüinventedütoüovercomeüthem.üTheyühaveüleadütoümodularüprogramming languagesü likeü Modula-2ü orü Adaü andü softwareü designü languagesü likeü HOODü [8]ü or EMILü[2].üForüaülongütimeütheseüideasüdidünotühaveüanyüsignificantüimpactüontoütheüdevelopmentüofüOOA/OODünotations.üTheirüapproachesüofferedüadühocüsolutionsüforüpartitioningüdiagramsüintoüsurveyableüpieces.üOMTü[9]üoffersüso-calledü“modules”,üwhich allowütoüdecomposeüunmanageableüdiagramsüintoüaünumberüofürelatedüdiagrams.üBut thereüareünoümeansütoüconstructüexportüorüimportüofümodules.üAsüaüconsequenceüanyütwo elementsüinüdifferentüdiagramsüwithütheüsameünameühaveütoübeüidentified.üEvenümore elaborateüconceptsülikeücategoriesüinüBoochü[1]üorücollaboratingüsubsystemsüwithücontractsüinWirfs-Brockü[13]üdoünotüstudyüinteractionsübetweenüinformationühiding,ümodule boundaryücrossingüassociations,üandüinheritance. The UnifiedüModelingüLanguageü[7]üasüaüsuccessorüofüBooch,üOMT,üandüOOSE,üisüthe firstüOOünotationüaddressingüallüfacetsüofüaüstate-of-the-artümoduleüconcept.üIts packages buildüshellsüaroundüarbitraryütypesüofüdiagramsü(staticüstructureüdiagrams,ücollaboration diagramsüetc.).üTheirüinformationühidingüconceptüisüstronglyüinfluencedübyüC++: (1) Explicitüimportürelationshipsühaveütoübeüusedütoüaccess publicüelementsüofüoneüpackageüwithinüanotherüpackage, (2) refinementü(generalization)ürelationshipsüprovideüaccessüto protectedüelements,üand (3) friendürelationshipsürevealüevenprivateü(butünotimplementation)üelementsüofüone packageütoüanotherüpackage. Furthermore,üUMLüsupportsünestingüofüpackagesüwithüvisibilityürulesüderivedüfromünestedüscopeürulesüofüprogrammingülanguagesüˆülaüModula-2üorüAda. OurümainüproblemsüwithüUML’sümoduleüconceptüareüasüfollows: (1) Allüconceptsüareüdefinedüinünaturalülanguageüonly.üThisümakesüitüdifficultütoüdetermineütheüpreciseüsemanticsüofüintroducedüterms. (2) Import,ürefines,üandüfriendürelationshipsübetweenüpackagesüareüindirectüsubclasses of ElementüandüinheritüaVisibleüattributeüwithüvaluesüfromütheüorderedüsetü{ public > protectedü>privateü>implementation}.üButüweüdidünotüfindüaüsingleülineüthatüex-
plainsü theü consequencesü ofü dependencyü visibilitiesü forü connectedü packages,ü althoughütheüusageüofüimportüandürefinesürelationshipsüwithüvaryingüvisibilityüvalues makesüsenseüfromütheüsoftwareüengineeringüpointüofüview. (3) Manyü strictlyü necessaryü constraintsü likeü “aü client Aü ofü anotherü (imported/referenced)üpackageBüshouldünotüaddü(own)üanüimportürelationshipüfrom Bütoüanother package C”üareünotüpartüofütheüUMLüsemanticsüdefinition. ThisüpaperüisüanüattemptütoütranslateütheünaturalülanguageüdefinitionüofüUML’süpackages intoü elevenü predicateü logicü formulasü thatü giveü preciseü answersü toü pointsü (1)ü andü (2) above.üWeüwillüsuggestümoreüformulasüaddressingüpointü(3)üaboveüinüaüforthcomingüpublication.üWithinüallüformulasütheüfollowingü(all-quantified)üvariablesüareüused: P,üP’,üP”üPackageüis_aüElement,üE üElement,üdep {exp_imports,ürefines,üfriend} , ’, ” {public >üprotected>üprivate>üimplementation}
2 AggregationüofüElementsüandüPackages AnyüUMLüdocumentücontainsüaünumberüofütop-levelüpackagesüwhichürepresentütheüregardedüsystemümodel.üEachüpackageüdefinesüaüvisibilityüshellüaroundüaünumberüofüelements, whichüareüeitherü(a)übasicüconstructsüofüaücertainütypeüofüdiagramsüorü(b)ünested packagesüorü(c)üdependenciesübetweenünestedüpackages.üAüpackage Pücontainsüanüelement E ifüitüownsüorüreferencesü(uses) E,üwhichübelongsütoüanotherüpackage P’.üInüthe latterücase,üwherePüreferencesE, Eümustübeüvisibleüinside P. Thisüsituationüisücaptured byütheüfollowingüpredicateülogicüformulas.üNoteüthatüformulaü(5a)üconsidersüonly visibilityüofünestedüpackageüelements .üTheüinteractionsübetweenüvisibleüelementsüandü(explicit)üimportürelationshipsüasüwellüasürefinementüareüsubjectüofüsectionsü3üandü4. Theüfollowingüformulasücannotübeüexplainedüinüdetail.üWeüdoühopeüthatüalmostüallüof themüareüself-explanatoryüasüsoonüasütheüroleüof üvariablesüisüclear.üTermsülike Püowns E or Püreferences E or Pücontains E or … haveütoübeüinterpretedüasü“package Püowns/references/contains/…element Eüwithüassociatedüvisibility ü{public >üprotected>üprivate>üimplementation}”.üPleaseünoteüthat theüconceptsowns, references,üandseesü(visibility)üareüdefinedüinüUML,üwhereas containsüandoffersüareüourüownüinventionsüinüorderütoükeepüformulasüasüsimpleüasüpossible. (1) Ownerüofüelementüisüunique: Püowns E üP’üowns’ E üP=üP’ = ’ (2) Elementsü(fromüotherüpackages)ümayübeüreferencedüifüvisible: Püreferences E üPüsees’ E ’ (3) Containsürelationshipüisüunionüofüownsüandüreferenceürelationship: Pücontains E üPüowns E üPüreferences E (4) Offersürelationshipüisütransitiveüclosureüofücontainsürelationship: Püoffers E üPücontains E üP’:üPücontainsüP’üP’üoffersüpublic E (5a) Visibilityüofüelementsü(ofünestedüpackages)üisüdeterminedüasüfollows: Püsees E üPüoffers E ü… Theümostüimportantüconsequenceüofütheüdefinitionsüaboveüisüthatüaüpackageüseesüall publicüelementsüofünestedüpackagesü(visibilityüisütransitive),üwhereünestedüpackagesüare eitherülocallyüdefinedüpackagesüorüimportedü(referenced)üpackages.üAüsurroundingüpackageühasünoüpossibilityütoühideüpublicüelementsüofünestedüpackagesüatüitsüownüinterface, exceptübyüowningüorüreferencingünestedüpackagesüthemselvesüwithürestrictedüvisibility.
3 Export/ImportüofüPackages Weühaveüseenüthatünestingüofüpackagesügivesüsurroundingüpackagesüaccessütoütheüpublic elementsüofüenclosedüpackages.üTherefore,üUMLüsaysüthatüownsüandüreferenceürelationshipsüestablishüaükindüof implicitüimport.üUsingüimplicitüimportsüonly,üpackagesüwould neverü beüableütoü referenceüelementsü ofü siblingü packages.üTherefore,ü UMLü hasüintroducedütheüconceptüofexplicitüimportü asüaüdependencyürelationshipübetweenüpackages thatübelongütoütheücommonüsurroundingüpackageüofütheürelatedüclientü(target)üandüserver (source)üpackage.üTheseüimportüdependenciesühaveütheirüownüvisibilityüattributes. Publicüimportürepresents,üforüinstance,üaükindüofüinterfaceüimport,üwhichüisüvisibleüforüallüclientsüofütheüsurroundingüpackage.üAn implementationüimport,üonütheüotherühand,üisüan alwaysühiddenüimport,üwhichürepresentsülocalüanalysisüorüdesignüdecisions. Theüfollowingüformulasüareüourüattemptütoüformalizeüimportsüandüexportsüofüpackages. Pleaseünoteüthatüpackagesüdoünotühaveüanyümeansütoüdefineüsetsüofüexportedüelements explicitely.üTheirpublic/protected/…üexportsüareüalwaysüimplicitelyüdeterminedüasütheir setsüofüpublic/protected/…üvisibleüofferedüelements.üAsüaüconsequence,üpackagesüdoünot onlyüexportüownüelements,übutüalsoüreferencedüelementsüfromüotherüpackages.üThisütakes fromü clientü packagesü theü cumbersomeü burdenü toü importü allü thoseü elementsü ofü other packagesüwhichüareüusedüinütheüinterfacesüofüalreadyüimportedüpackages. (6) Implicitüimportüareüallüindirectlyüownedüorüreferencedüelements: Püimp_imports E P’:üPücontainsüP’üP’üoffersüpublic E (7) Importüisütheüunionüofüexplicitüandüimplicitüimport: Püimports E üPüexp_imports E üPüimp_imports E (8) Exportüisüsetüofüallüofferedünonimplementationüelements: Püexports E üPüoffersüE implementation (5b)Visibilityüofüelementsüacrossüpackagesüisüextendedüasüfollows: PüseesüEüPüoffersüE P’:üPüexp_importsüP’üP’üexportsüE)
4 RefinementüofüPackages Theüpreviousütwoüsectionsüintroducedütheü“classical”ümodularizationüconceptsüofüprogrammingülanguagesülikeüModula-2,üi.e.ütheüconstructionüofüexportüinterfacesüforüpackagesü (withü varyingü degreesü ofü visibilityü inheritedü fromü C++),ü nestingü ofü (local) packages,üandütheüestablishmentüofüvisibleüorühiddenüimportürelationshipsübetweenüpackages.üTheseüimportürelationshipsüpermitüaccessütoüpublicüinterfaceüelementsüofüserver packages,üonly.üTheüremainingütwoüvisibilityüvaluesü(forüinterfaceüelements) protectedüandprivate üareüonlyüusefulüinücombinationüwithürefinementü(generalization)üand friendürelationshipsübetweenüpackages.üTheüconceptüofüfriendsüisünotüdiscussedüinüthis paper,üwhereasütheüconceptüofürefining/generalizingüpackagesüwillübeüexplainedühere. Theümainümotivationüforüintroducingüthe refinementü (subtype) relationshipübetween packagesüisüthatütheüimportantüOOüconceptüof inheritance shouldünotüonlyübeüavailable forüdefiningüsingleüclasses,ütheübasicüelementsüofüstaticüstructureüdiagrams,übutüalsoüfor definingüandürefiningüarbitrarilyücomplexüsubdiagrams. Itüisünotüatüallüdifficultütoücomeüupüwithüaüpreciseüdefinitionüofütheüconsequencesüofürefinementü(generaliziation)ürelationshipsüforütheüvisibilityüofüpackageüelementsüasüwellüas withüaüformalüdefinitionüofütheüconstraintü“ generalizationürelationshipsüdoünotübuildücycles”.üItüisüfarümoreüdifficultütoütranslateütheümeaningüofüsentencesülikeü“ …üanüinstance
ofütheüsubtypeüisüsubstitutableüforüanüinstanceüofütheüsupertype ”.üTheülatterüconstraint cannotübeüdefinedüforüpackagesüinügeneral,übutümustübeüstudiedüforüeachülanguageüof UMLüdiagrams,üseparately.üSuchüaüpreciseüdefinitionüofütheütermü“substitutability”üisünot partüofüUML.üTherefore,üourüformulasüwillüonlyütakeütheüconsequencesüofüpublicürefinementürelationshipsüforütheüvisibilityüofü(public)üinterfaceüelementsüofürelatedüpackages intoüaccount.üForüfurtherüdetailsüconcerningütheüformalütreatmentüofüsubtypingüfromüan algebraicüpointüofüviewütheüreaderüisüreferredütoü[3]üandüfromüaütype-theoreticüpointüof viewütoü[6].üItüisüanüopenüquestionüwhetherüsimiliarüconstraintsühaveütoübeüaddedüforüthe caseüofünon-publicürefinementürelationshipsüandüinterfaceüelements. (9) SubtypeOfürelationshipüisütransitiveüclosureüofürenesürelationship: PüsubtypeOfüP’ üP”,:üPürenesüP”üP”ü=üP’üP”üsubtypeOfüP’) (10)Renesü(generalization)ürelationshipüisüacyclic: (PüsubtypeOfüP) (11)Publicüexportüofüreningüpackageühasürenedüpackage’süexport: PürenesüpublicüP’üP’üexportsüpublicüE üPüexportsüpublicüE (5c) Visibilityüacrossüpackageüboundariesüisüextendedüasüfollows: PüseesüEü…ü(*üseeüDef.ü(5b)ü*) P’, ’, ” üprotected:üPürenes’üP’üP’üexports”üE =ümin(’,”) Pleaseünoteüthatüformulaü(5c)üaboveüisüjustüanüextensionüofüformulaü(5b)üofütheüprevious section.ü Itü takesü refinementü relationshipsüwithü differentü degreesü ofü visibilityü intoü account,ürangingüfromüaükindüof publicüsubtypeüinheritanceütoüpureimplementationüinheritance.üItüsaysüthatüaürefiningü(subtype)üpackageüseesüallüpublicüelementsüofütheürefined (supertype)üpackageüasüpublicüelementsü(ifütheürefinementürelationshipüisüpublic,ütoo).üIt statesü furthermoreü thatü aü refiningü packageü seesü allü protectedü elementsü ofü theü refined packageüas protected visibleüelementsü(ifütheürefinementürelationshipüis üvisible, too).üItüisüanüopenüquestion,üwhetherüitümakesüsenseütoühaveüfourüdifferentüvisibilityücases forürefinementürelationships,üinsteadüofütheüusualüdistinctionübetweenüinterfaceüpreservingüsubtypeüinheritanceüandütheühiddenüinheritanceüofüimplementations.
5 Summary ThisüpaperüpresentedüaücompactüdefinitionüofütheüUMLünotation’sümodularizationüconcept.üTogetherüwithüaünumberüofüusefulüextensionsüweücouldüavoidüobviousüincompletenessesüinüitsünaturalülanguageüdefinitionüorürepresentüadditionalüpoliciesüforütheüdefinitionüofüimport,ürefinement,üandüfriendürelationshipübetweenüpackages. Weühaveüomitted theüconsiderationüofütheüfriendsüconceptühere,ütheüvalueüofüwhichüisüdoubtfulüforüobjectorientedüanalysisüandüdesign.üTheüpreciseüdefinitionüofüaüOOA/OODümoduleüconceptüis notüanüisolatedüactivityüatüourüdepartment,übutüanüintegralüpartüofütheüfollowingüprojects: (1) TheümoduleüinterconnectionülanguageüEMILühasübeenüdevelopedüatüourüdepartment offeringüdifferentütypesüofümodules,ünestedü(sub-)systems,üimport/exportürelationshipsübetweenümodulesüandü(sub-)systems,üinheritanceüforüabstractüdataütypeümodulesüasüwellüasügenericityüinütheüsenseüofügenericüAdaüpackagesü[5,2]. (2) Ourü formalü backgroundü areü logic-basedü graphü rewritingü systemsü [10].ü Theyü are usedinütheüformüofütheüvisualüspecificationülanguageüandüenvironmentüPROGRES [12]toüdefineügraphicalüsoftwareüengineeringülanguagesüandütoüprototypeütoolsüfor them.üWeüareüaboutütoüspecifyüaüsignificantüsubsetüofüUMLüinüPROGRES.
(3) Graphü rewritingü specificationsü forü complexü languagesü likeü UMLü tendü toü beü too largeütoübeüwrittenüdownüasüaüsingleüunstructuredüdocument.üTherefore,üweühave startedütoüdevelopüaümoduleüconceptüforüPROGRESüsimiliarüEMILüandüUMLü[11]. Toüsummarize,üneitherüUML’sümoduleüconceptüitselfünorütheüconsiderationsüpresented hereüconcerningüitsüformalüdefinitionüandünecessaryümodificationsüareürestrictedütoüaüsingleüobject-orientedüanalysisüandüdesignümethod.üOnütheücontrary,ütheüpresented module conceptümayübeüaddedütoüotherüanalysis,üdesign,üorüspecificationülanguages üorüitümay evenübuildütheübasisüforüaüseparateümoduleüinterconnectionülanguage.üThisüisüdueütoüthe factüthatüpresentedüformulasümakeünoüassumptionsüaboutütheüsemanticsüofübasicüelements inüpackages.üItüisütheirüexclusiveüpurposeütoüexplainütheüimpactüofüpackagesüandürelationshipsübetweenüpackagesüonütheüvisibilityüofüpackageüelements.üAsüaüconsequence,üthis paperücomplementsütheürapidlyügrowingünumberüofüpublicationsüwhichühaveüeitherüthe formalüdefinitionüofümoduleüinterconnectionülanguagesü(architectureüstyles)üorücertain OOüdiagramütypesüasü theirümainütopic.üBothücategoriesüofü papersü assumeüeitherüvery simpleüvisibilityürulesüorüneglectüthisüaspectüdueütoütheüabsenseüofüaümoduleüconcept.
References [1] Booch G.: Object-OrientedüAnalysisüandüDesign .üSeriesüinüObject-OrientedüSoftwareüEngineering.üBenjaminüCummings,üRedwoodüCity,üCA,ü1994. [2] Bšrstler J.: Programmieren-im-Großen:üSprachen,üWerkzeuge,üWiederverwendung.üDissertationü(RWTHüAachen),üTRüUMINFü94.10,üDepartmentüofüComputer Science,üUmeŒüUniversity,üSweden,ü1994. [3] Breu R.: Algebraicü Specificationü Techniquesü inü Object-Orientedü Programming Environments,üLNCSü562.üSpringer-Verlag,ü1991. [4] Jacobson I.: Object-Orientedü Softwareü Engineering:ü Aü Useü Caseü Drivenü Approach.üAddison-Wesley,üReading,üMA,üfourthüedition,ü1994. [5] Nagl M.: Softwaretechnik:üMethodischesüProgrammierenüimüGroßen .üSpringerVerlag,ü1990. [6] Palsberg J.,ü Schwartzbach M. I.: Object-Orientedü Typeü Systems.ü Johnü Wiley, NewüYork,üNY,ü1994. [7] RationalüSoftwareüCorporation:UMLüSemantics,üVersionü1.0 .ühttp://www.rational.com,ü1997. [8] Robinson P. J.: HierarchicalüObject-OrientedüDesign.üPrenticeüHall,üEnglewood Cliffs,üMA,ü1992. [9] Rumbaugh J.,üBlaha M.,üEddy W.üP. F.,üLorensen W.: Object-OrientedüModeling andüDesign.üPrenticeüHall,üEnglewoodüCliffs,üNJ,ü1991. [10] SchŸrr A.: LogicüBasedüProgrammedüStructureüRewritingüSystems .üFundamenta Informaticae,üXXVI(3/4),ü1996. [11] SchŸrr A.,üWinter A. J.:ModulesüandüUpdatableüGraphüViewsüforüPROgrammed GraphüREwritingüSystems.üTRüAIBü97-3,üRWTHüAachen,üGermany,ü1997. [12] SchŸrr A.,ü Winter A. J.,ü ZŸndorf A.: Graphü Grammarü Engineeringü withü PROGRES.üInüSchŠfer W.,üBotella P.ü(eds.):üProc.ü5thüEuropeanüSoftwareüEngineering Conf.ü(ESEC’95),üLNCSü989,üpp.ü219–234.üSpringerüVerlag,üBerlin,ü1995. [13] Wirfs-Brock R.,üWilkerson B.,üWiener L.:DesigningüObject-OrientedüSoftware. PrenticeüHall,üEnglewoodüCliffs,üNJ,ü1990.
TowardsüaüDedicatedüObjectüOriented SoftwareüProcessüModellingüLanguage WiebkeüReimer,üWilhelmüSchŠfer,üThomasüSchmal {wiebke|wilhelm|schmal}@uni-paderborn.de Dep.üofüComputerüScience,üSoftwareüEngineeringüGroup UniversityüofüPaderborn,üD-33095üPaderborn
Abstract Thisüpaperüreportsüourüexperienceüinüdesigningütheüexecutableüobject-orientedüsoftwareüprocess modellingülanguageESCAPE+.üStartingüwithüaüflexible,üOMT-likeülanguage,üweüextendedüthe run-timeü systemü withü specificü processü andü softwareü configurationü managementü functionality whichüisüaccessibleütoüprocessüengineersüthroughüparticularüpre-definedüclasses.
Motivation Theüenormousüincreaseüinücomplexityüandüsizeüofüsoftwareüproductsüleadsütoüincreasing problemsüofümanagementüofülargeüsetsüofüdocuments,üconsistencyüpreservationüofüfrequentlyüchangingüdocumentüversions,üandücoordinationüofüteamüwork.üSoftwareüconfigurationü managementü (SCM)ü andü Softwareü Processü Managementü areü complementary methodicalüapproachesütoükeepütheseüproblemsüunderücontrol.üTheyücanübeü exploited bestüinütheüformüofüaüprocessümodellingülanguageü(PML)üwhichüencompassesüSCMüaspects,üinsteadüofübasingüoneüofütheüapproachesüonütopüofütheüother.üExecutableüPMLsüenableütheüconstructionüofüprocess-centredüsoftwareüdevelopmentüenvironments.üThatüis, theürun-timeüsystemüofütheüPMLüprovidesüprocessüsupportüinüaccordanceüwithütheüspecifiedüprocessümodelü(PM). Likeüwithüanyülanguage,üitüisüimportantüthatüthereübeücommonüunderstandingüofüaüPML amongüitsüdesigners,üimplementorsüandüusers. DesignersüdefineütheüPML. Implementors developütoolsüforütheüPML,üsuchüasüprocessümodelüeditors,üstaticüandüdynamicüanalysers ofü(executable)üPMs,üand,ünotütoüforget,ütheürun-timeüsystemüitself. UsersüofütheüPML, called processüengineers,üspecifyüPMs.üTheüsyntaxüandüsemanticsüdefinitionüthatüdesignersüprovideüforüimplementorsüandüprocessüengineersümustübeüasüpreciseüasüpossibleüin orderütoüavoidütheüambiguitiesüandüsubtletiesücommonütoünaturalülanguage.üOnlyüthisüenablesütheüeffectiveüuseüofütheüPML:ücreating,üunderstanding,üreusing,ümodifyingüandüanalysingüPMs.üItücanüevenüenableüaü(partly)ügenerationüofüPMLütoolüimplementations. Weüdistinguishübetweenüthestaticüandüthedynamicüsemanticsofüaülanguage.üTheülatter isü theümeaning üofüaüphraseüinüthatülanguage.üTheüformer,üalsoücalledücontext-sensitive syntax,üdefinesüconstraintsüonütheüwell-formednessüofüaüphraseüwhichügoübeyondücontext-freeügrammar. Object-orientedülanguagesüallowüforüreusabilityüthroughüclassülibraries.üSpecialization andüinstantiationüareüexamplesüforüre-useümechanisms.üOftenüitüisünotüeasyütoüproperly useüaülibraryüclass:üThereüareü(notüexplicitlyüstated)ürestrictionsüonübothüthe staticüpropertiesüandüthedynamicübehaviourüofüaüusingüclass.üThatüis,ütheüpre-definedülibraryüelementsü carryü aü specificü semantics.ü Weü argueü forü promotingü theseü elementsü intoü the languageüinüorderütoübeüableütoüdefineüandüautomaticallyücontrolüsuchüstaticüandüdynamic semanticsüconstraints.
InüthisüpaperüweüinvestigateütheüPML ESCAPE+.üWeüstartübyüdescribingüitsüpredecessor ESCAPEüwhichüisüveryüflexibleübutüprovidesüonlyüaüfewüdedicatedüconceptsütoüdefine processümanagement. ESCAPE+üisü anüextensionüof ESCAPEüwhichüincludesüpre-definedülibraryüclassesüthatühaveüaüparticular,ücomplexüsemantics.üForüexample,üaünumber ofüclassesüdefineüaügeneralümodelüforüSCM.üThisüisücomparableütoü OO-Frameworks (whichüare,üunlikeüDesignüPatterns,üexecutable).üInüorderütoüensureütheücorrectüusageüof theseü pre-definedü elementsü weü definedü aü dedicated,ü veryü rigorousü inheritanceü model whichübecameüanüintegralüpartüofütheünewülanguage,ünamely ESCAPE+.
Whereüweüstarted ESCAPEü[Jun95]üisüanüexecutableüobject-orientedüPMLüwhichüenablesütheüconstruction ofüaüflexibleüprocess-centredüsoftwareüdevelopmentüenvironment.üAsüaümodificationüof OMTü[RBP+91]üitüincorporatesütheüflexibilityüandüpowerüofüobjectüorientedüspecification.üSeveralüreal-worldüPMsühaveübeenüspecifiedüin ESCAPE,ülikeüe.g.ütheüconfigurationümanagementüprocessüofüaülargeülocalücomputerüvendor. AüPMüinESCAPE consistsüofüthreeüparts:üTheüObjectüModelüdefinesüstaticüproperties suchüasüinheritanceühierarchiesüofüdocumentüclasses,üassociationütypes,üattributesüand methodsü applicableü toü instancesü ofü aü class.ü Theü Coordinationü Modelü containsü a statechartüforüeachüdocumentüclass.üTheüOrganisationüModelüdefinesüroleütypesüandütheir responsibilities.üInücontrastütoüOMT, ESCAPE definesüinüdetailütheüstaticüsemanticüconstraintsübetweenüallütheseüpartsüandüthusümakesüthemüamendableütoüautomaticücontrol. LookingüatütheüPMsüspecifiedüin ESCAPE weühaveümadeütheüfollowingüobservations: • Weüidentifiedüsub-modelsüwhichüareüpartüofüalmostüeveryüPM,üwithüveryüfewüvariationsübetweenütheüdifferentüoccurrences.üEspecially,üsoftwareüconfigurationümanagementühadübeenüspecifiedüinüaüveryüsimilarümannerüinütheseüPMs. • Thereüwereümanyüconstraintsüonühowütoücorrectlyüre-useüpre-definedüclasses.
Whereüweüareünow TheüdesignüofESCAPE+üwasüorientedütowardsütheüfollowingüobjectivesüwhichüemerged fromütheüaboveüobservations: • WeüwantedütoümakeüSCMüandüotherürecurrentüprocessümanagementüconceptsüanüintegralüpartüofütheürun-timeüsystem.üThisürelievesüprocessüengineersüfromümodelling theseücomplex,übutüapparentlyürelativelyüfixedüpartsüofüaüPM.üFurther,üitüenablesüto provideümoreüsophisticatedüandüefficientlyüimplementedüsupportüwithoutüintroducingülow-level,üproceduralüprogrammingülanguageüconstructsüintoütheüPML. • Theüpre-definedüfunctionalityüshouldübeücustomizeable. • Theüconstraintsüonühowütoücorrectlyücustomizeüshouldübeüautomaticallyücontrollable. Toüattainütheseüaims,üweütookütheüfollowingüapproach:üWeüpre-definedüseveralüclasses whichühaveüaüparticularüprocess-üorüSCM-relatedüdynamicüsemantics.üThisüsemanticsüis notümodelledüinütheüPMLübutühard-codedüinütheürun-timeüsystem. Fig.ü1üshowsüanüexcerptüofütheüObjectüModelüwhereüpre-definedüclassesüareüshaded. Asü anü exampleü forü pre-defined process-relatedü semanticsü takeü class .üAtürun-time,üanüinstanceüofüthisüclassüisüautomaticallyücreatedüwhen üisüexecutedüonüanüinstanceüofüaüclassütoüwhichütheüformerühasüanüassociationüedge ofütype .üForütheüspecializedüclassesüthisümeansüthatücompilingü(
Document attributes: .ü.ü.
depend-on
activities: Move(...),üCopy(...) Derive(...),üMerge(...) Freeze(...),üModify(...) Use(...),üGenerate(...) PropagateChanges(...)
generated-from
EditableDoc .ü.ü. .ü.ü.
FullyEditableDoc .ü.ü. .ü.ü.
FullyEditableDoc .ü.ü. .ü.ü.
Specification .ü.ü. .ü.ü.
C-Module .ü.ü. print(...)::Use review(...)::Use compile(...)::Generate
imports:: depend-on
System attributes: .ü.ü. activities: Move(...),üCopy(...) Derive(...),üMerge(...) Freeze(...), Use(...), ZoomIn(...),ü.ü.ü.
part-of part-of
FullyGeneratedDoc .ü.ü. Modify(...) PropagateChanges(...)
DesignSystem .ü.ü. .ü.ü. part-of-design:: part-of
ObjectüFile .ü.ü. .ü.ü.
Implementation .ü.ü. .ü.ü.
part-of-impl:: part-of
compiled-from:: generated-from
part-of-impl:: part-of
includes::depend-on
specified-in::generated-from
part-of-design::part-of
Figureü1:AnüObjectüModelüwithüpre-definedüandüspecializedüclasses
)üa ücreatesüanüinstanceüof üandürelatesütheütwoüinstancesüby a -edge.üClass üimplementsüanüaggregateütype.üSomeüactivities in üand üperformüaggregate-relatedüfunctionality,üsuchüasümovingüa componentüfromüoneüaggregateütoüanotherü( ). Activities üand ümanipulateüversionühistories,üi.e.ütheyüimplementüpredefined SCM-relatedüsemantics.üTheüstatechartsüofüpre-definedüclassesürestrictütheirüinstances’übehaviourütoüanüorderüofüactivityücallsüwhichüisüsensibleüw.r.t.üSCM.üE.g.üderivingüaünewüversionüfromüaüdocumentücanüonlyübeüdoneüafterüitühasübeenüfrozen,üandüonce itühasübeenüfrozen,üitücanünoülongerübeümodified.üVersioningüisüalsoüprovidedüforüclass ,üwhichüenablesütoübuildühierarchicalüconfigurations. Inüorderütoüprovideüthisücomplexübuilt-inüfunctionality,üweümustüensureüthatüanyüclass, anyüactivityüa.s.o.üspecifiedübyütheüuserücanübeüclassifiedüw.r.tüthisübaseüfunctionality. Weüachieveüthisüby (a) requiringüthatüclassesüdefinedübyütheüprocessüengineerübeüderived (directlyüorüindirectly)üfromüaüpre-definedüclass,üandüby (b)üdefiningüaürigorousüinheritanceümodel.üByüdoingüso,ütheüpre-definedüclassesühaveübecomeüanüindispensableüpartüof theürun-timeüsystemüandüareüthusüpartüofütheüPML. Briefly,üthisüinheritanceümodelüallowsüfor specializingüordeletingümodelüelements,übut notüforaddingünewüones.üThisüholdsüforüObjectüModelüelementsüsuchüasüactivities,üattributes,üassociationüroles,üandüforüelementsüofütheüCoordinationüModelüsuchüasüstates,
transitions,ütransitionülabelsüetc.üRequiringüthatüuser-definedüelementsübe specializations ofüpre-definedüonesüallowsüusütoüassociateüaüpre-definedüsemanticsüwithüthem. Anüexampleüforüthisücanübeüseenüinüclass .üTheüinheritedüpre-definedüactivity ühasübeenüspecializedüintoütwoüactivities üand üThisümeansüthatüwith regardütoütheüpre-definedüprocess-semantics,übothüactivitiesübehaveülike.üYetüin ’süstatechart,ütheüprocessüengineerücanüdistinguishübetweenüthemüandüspecify, forüinstance,üthatüprintingüaüC-Moduleüisüallowedüatüanyütime,üwhereasüaüreviewücannot beümadeüuntilüeditingüisüfinished. Onütheüotherühand,üweümustüalsoüallowüfor deletingüinheritedüproperties:üSinceüweüprohibitüextensionsütoüaüPM,ütheüpre-definedüPMümustüincludeüwhateverücanümakeüsenseüin aüuser-definedüPM.üNotüallütheseüpre-definedüelementsümustüappearüinüaüuser-defined PM,übutüsomeüofüthemüdo.üThereforeümostüPMüelementsüareüattributedüeither üor ü(whichüisünotüalwaysüshownüinüFig.1). üelementsümustünot beüdeleted.üNoteüthatüunlikeütheümultiplicityüofüassociationürolesüinüOMT,üthisüisüaütypelevelüconstraint.üWhenüspecializingüsuchüanüelement,ütheüconstraintücanübeüstrengthened from üto ,übutünotütheüotherüwayüround. InüFig.ü1,ütheüshortülineücrossingüoneüsideüofüanüassociationüedgeüdefinesüthatüthisüassociationüroleüisüoptional. ,üforüinstance,üisüpre-definedüinüclassüDocumentü withü bothü rolesü beingü optional.ü Forü class ,ü the outgoingüassociationüedgeüisüdeleted. -üand s,üinücontrast, mustühaveüanüoutgoingüassociationüedgeüofütypeügeneratedüfrom,üthereforeütheücorrespondingüdocumentütypesüredefineütheüoutgoingüassociationüroleüasübeingümandatory. Theüotherüassociationüroleüremainsüoptional,ümeaningüthatünotüeveryüclassüderivedüfrom ümustübeütargetüofüanüassociateüedgeüderivedüfrom .üAssociation üinüclass üisüaüuser-definedüspecializationüof . ESCAPE+ isüsubjectüofüaüforthcomingüdissertationü[Sac97].üInü[NSS96]üweüpresented anüearlierüversionüofESCAPE+üwhichüdidünotüyetüfullyüincorporateütheürigorousüinheritanceümodel,üthusüstillüimposingüimplicitüspecializationürestrictions. References [Jun95]
G. Junkermann.ü Aü Dedicatedü Processü Designü Languageü basedü onü EERthüInt.üConf.üonüSoftwareüEnmodels,üStatechartsüandüTables.üIn Proc.üofütheü7 gineeringüandüKnowledgeüEngineering ,üRockville,üMaryland,üUSA.ü1995
[NSS96]
O. Neumann,ü S. Sachweh,ü W. SchŠfer.ü Aü High-Levelü Object-Oriented SpecificationüLanguageüforüConfigurationüManagementüandüToolüIntegrathüEuropeanüWorkshopüonüSofttion.üInüC. Montangero,üed.,Proc.üofütheü5 wareü Processü Technology,p.ü 137–143.ü Springerü Verlag,ü Nancy,ü France, Oct.ü1996.
[RBP+91] J. Rumbaugh,ü M. Blaha,ü W. Premerlani,ü F. Eddy,ü W. Lorensen.Object– Orientedü Modelingü andü Design .ü Prenticeü Hall,ü Englewoodü Cliffs,ü N.ü J. 07632,ü1991. [Sac97]
S. Sachweh. üKoKoSü–üEinükooperativesüKonfigurationsmanagementsystem . PhDüthesis,üUniv.üofüPaderborn,üGermany,ütoüappearüinü1997.
2ndüWorkshopüon Component-OrientedüProgramming (WCOP’97)1 Summary JanüBosch
WolfgangüWeck
UniversityüofüKarlskrona/Ronneby DeptüofüComputerüScience Ronneby,üSweden [email protected]
•boüAcademy DeptüofüComputerüScience •bo,üFinland
ClemensüSzyperski QueenslandüUniversityüofüTechnology SchoolüofüComputingüScience Brisbane,üAustralia
WCOP'97,üheldütogetherüwithüECOOP'97üinüJyvŠskylŠ,üwasüaüfollow-upüworkshopüto theü successfulü WCOP'96,ü whichü hadü takenü placeü inü conjunctionü withü ECOOP'96. WhereüWCOP'96ühadüfocusedüonütheüprincipalüideaüofüsoftwareücomponentsüandütheir goals,ü WCOP'97ü wasü moreü directedü towardsü compositionü andü otherü topics,ü suchü as architectures,ü glue-ing,ü componentü substitutability,ü evolutionü ofü interfaces,ü andü nonfunctionalürequirements. WCOP'97ühadübeenüannouncedüasüfollows: COPühasübeenüdescribedüasütheünaturalüextensionüofüobject-orientedüprogramming toütheürealmüofüindependentlyüextensibleüsystems.üTheümostüprominentüexamplesüofüsuch systemsüareüconstructedüaroundücompoundüdocumentümodelsüsuchüasüOLE,üOpenDoc, JavaBeans,üorüNetscapeüONEüandürestüonüobjectümodelsüsuchüasüSOM/CORBA,üCOM orüJava'süvirtualümachine.üWCOP'97üintendsütoüaddressütheirümethodologicalüandütheoreticalüunderpinnings. üCOPüaimsüatüproducingüsoftwareücomponentsüforüaücomponentümarketüandüforülate composition.üComposersüareüthirdüparties,üpossiblyütheüendüuser,üwhoüareünotüableüor willingütoüchangeücomponents.üThisürequiresüstandardsütoüallowüindependentlyücreated componentsütoüinteroperate,üandüspecicationsüthatüputütheücomposerüintoütheüposition toü decideü whatü canü beü composedü underü whichü conditions.ü Theseü needsü raiseü open 1.üTheüworkshopüreaderücontainsüshortüversionsüofütheüworkshopüpapers.üFullülengthüpapersühave beenüpublishedüinütheüTUCSüGeneralüPublicationsüSeries,üVol.ü5,üISBNü952-12-0039-1,ü1997. (http://www.tucs.abo.fi/publications/general/G5.html).
researchü questionsü likeü whatü kindü ofü standardsü areü neededü andü howü theyü shouldü be dened.üOrüwhatüinformationüspecicationsüneedütoügive,ühowüthisüinformationüshould beüprovided,üandühowücorrectüimplementationüandüusageüofüspecicationsücouldübeüveriedüorüenforced. 16ü positionü papersü wereü submittedü toü theü workshopü andü formallyü reviewed.ü 12 papersüwereüacceptedüforüpresentationüatütheüworkshopüandüpublicationüwithütheüproceedings.üStill,ü25üparticipantsüfromü13ücountriesüwereücountedüatütheüworkshop. Duringü theü morningü session,ü participantsü presentedü theirü work,ü whichü coveredü a wideürangeüofütopics.üAümajorüthemeüwasühowütoüselectücomponentsüforücompositionüin aüspecicüsituation.üSuchüaüselectionümustürestüonütwoüpillars.üFirstly,ütheüselectedücomponentsümustübeücompatibleüwithüeachüother.üSecondly,ücharacteristicsüthatüareünotüpart ofü theü standardizedücomponentüinterfaceü mayüdecideü whichü componentü toü picküfrom otherwiseü equalü ones.ü Examplesü areü timeü orü resourceü requirements,ü faultü tolerance, degreeüofüdistribution,üetc. Toüaddressütheücompatibilityüofücomponents,üvariousüapproachesüandüphilosophies wereüpresented.üAnüimportantüpropertyüofücomponent-orientedüprogrammingüisüthatüa singleü specicationü mayü beü supportedü byü multipleü implementations.ü However,ü problemsümayüariseüifüindividualüimplementationsüdependüonütheüimplementationüofüother components.ü Theseü dependenciesü mayü causeü conicts,ü whichü canü oftenü onlyü be detectedüwhenütheücomposedüsystemüisüanalysedüasüaüwhole. Oneüsolutionüisüthatüdependenciesüonüotherücomponentsüasüwellüasüknownüconicts withüotherücomponentsübecomeüpartüofüaücomponent'süspecication.ü ReuseüContracts [deüHondtüetüal.]ühaveübeenüproposedüasüaütoolüforüthis.üTheyüalsoüallowütheücomposerüto decideüquicklyüwhetherüaügivenüsetüofücomponentsümayüconict. [Mikhajlovü&üSekerinski]üsuggestü toü deneürulesüthat,ü ifübeingüfollowed,üexclude conictsüinüprinciple.üTheseürulesüaffectütheüdesignüofüspecications,ütheüimplementationüofücomponents,üandütheüimplementationüofüaücomponent'süclients.üForüinheritance betweenüclassesüofüobjects,üsuchürulesücanübeüderivedüformally. Aüthirdüapproachüisütoüacceptüthatücomponentsüwillühaveüsomeüdependenciesüthatüare notüpartüofüaüspecicationüandühenceücannotübeücheckedübyütheücomposer.üTheücomponentücreators,ühowever,üareüawareüofütheseüdependencies.üThus,üthisüknowledge,üavailableü duringü componentü creationü time,ü hasü toü beü maintainedü andü madeü accessibleü to systemücomposers.ü[Murer]üsuggestsüthatüthisürequiresütoolüsupport. Finally,üaücomponentümayünotübeüapplicableüinüaüspecicüsituationüasüitüis.üInüthese cases,ü itü needsü toü beüadapted,ü whichü canü beü doneü eitherü byümodifyingü theü program's sourceücodeüorübyüwrappingüit.üBothüapproachesühaveütheirüdisadvantages.üAlternatives onü aü middleü groundü areü needed.ü [Bosch]ü proposesü theü useü ofü componentü adaptation typesüthatücanübeüsuperimposedüonücomponents. Oneüaspectüofüspecicationsüisüthatütheyüembodyüaücontractübetweenüprogrammers ofüserviceüprovidingücomponentsüandüserviceüclients.üBecauseüitüisüimpossibleütoütestüa providerücomponentüagainstüallüclientsüandüvice-versa,üitümustübeüdecidedüwithoutütestingübothüwhetherüaüspecicationüisüimplementedücorrectlyüandüwhetherüaüclientüusesüit correctly.üForüthis,üformalümethodsüareühelpful,übutüneedütoübeümadeüapplicableüinüpractice.ü [BŸchiü &ü Sekerinski]ü addressü theü problemü ofü poorü scalabilityü byü specication statements,üwhichüareüusedüinürenementücalculus.
Theüsecondümayorüthemeüofütheüpresentedüworküwereüpropertiesüofücomponentsüthat areünotüpartüofütheü(functional)üstandardüinterface.üOneümayüwantütoüaddüsuchüproperties toüexistingücomponentsüwhenüputtingüthemütogetherütoüaücompleteüsystem.üThisüallows theüsystem'sücomposerütoüpicküthoseüpropertiesüthatüareüactuallyüneededüinütheüspecic situation.ü [Troyaü&ü Vallecillo]üdiscussüsomeütechnicalüprecautionsüforüthis,ü suchüasüa specicücommunicationümechanism.üAnüexampleüofüsuchüadd-onüpropertiesüareümechanismsü forü run-timeü faultü managementü inü distributedü systems.ü [Baggioliniü &ü Harms] proposeütoüuseüwrappersüforüprovidingümonitoring,üdiagnosis,üorüfailureücorrection. Componentsü thatü areü otherwiseü interchangeableü willü distinguishü themselvesü by someü importantü (unchangeable)ü properties,ü suchü asü resourceü requirements.ü Itü isü an importantütaskütoüselectütheürightücomponents,ümeetingüpossibleüconstraintsüimposedüby theüdeployingüsystemüorütheüproblemütoübeüsolved.ü[Lalanda]üsuggestsüthatüthisüselectionümayübeübestümadeüatürun-time,üandüproposesüaüspecialüarchitecture. Someü ofütheüworküaddressedüotherütopicsüthanütheseütwoü mainüthemes.üWorkow systemsü seemü toü lendü themselvesü toü component-orientedü software,ü becauseü ofü their congurabilityüandübuilding-block-likeüstructure.ü[Schreyjak]üproposesüaüspecialücomponentüframeworkütoüsupportücomponent-basedüworkowüsystems.üOneüwayüofücomposingü systemsüisü byüexpressingü relationsüandü cooperationü betweenücomponentsü inüa specialü language.ü [Steensgaardü Madsen]ü proposesü anü interpretedü language,ü inü which theü commandsü areü components.ü Suchü languageü interpretersü areü specializedü forü an applicationüdomainüandüneedütoübeügeneratedüautomatically.ü[Weck]üdiscussesütheüproblemsü ofü codeü inheritanceü acrossü componentü boundaries,ü suchü asü theü dangerü for unwantedü dependencies.ü Instead,ü inheritingü classesü needü toü referü toü specicationsü of baseüclasses.üWithüthis,üinheritanceücanübeüreplacedübyüobjectücompositionüwithoutüsacricingütheüpossibilityüofüstaticüanalysis,üyetübeingümoreüexible. Becauseüofütheümanyüparticipants,üduringütheüafternoonüsessionütheüworkshopüwas splitüupüintoüdiscussionügroups.üTheüparticipantsüexpressedüinterestüinüfourüareas:üComponents,ü Architectures,ü Non-Functionalü Requirements,ü andü Glue.ü Theü followingü are shortüsummaries,übasedüonüpresentationsüandünotesüprovidedübyüdifferentüparticipants ofütheüdiscussionügroups. Components:üAsüaüstart,üitüwasürecognizedüthatüwhatümakesüsomethingüaücomponentüisüneitherüaüspecicüapplicationünorüaüspecicüimplementationütechnology.üInüthis sense,ü“anything”ümayübeücastüintoüaücomponent.üToüprovideüaccessütoüsomethingüabout whichüsoülittleüisüknown,üanüinterfaceüneedsütoübeüprovided.üInterfacesüareümainlyüseen asüaücollectionüofü“ServiceüAccessüPoints”,üeachüofüthemüincludingüaüsemanticsüspecication.üTheümainüpurposeüofücomponentsüisüreuseüofübothüimplementationsüandüinterfaces.ü Forü effectiveü implementationü reuse,ü theü aforementionedü independenceü from implementationütechnologyüisüparticularlyüimportant.üTwoükindsüofülifeücyclesüareütoübe distinguished:üthatüofütheüinterfaceüandüthatüofütheücomponentüitself.üTheülatterüisüshorter thanütheüformer,übecauseütheüinterfaceüexistsüasülongüasüanyüimplementationüisüaround. Forüinterfaces,üformalizationüofüsemanticsüisünecessary.üEvenümoreüimportant,ütheüinteroperationübetweenücomponentsümustübeüdescribed.üOnütheütechnicalülevel,üoneüneedsüa binaryü interoperationü standardü andü aü mechanismü toü mapü semanticsü specicationsü to implementationsüusingüthisübinaryüstandard.
Architecture:ü Architectureü describesü compositionsü ofü components,ü andütherefore relationshipsübetweenüthem.üThisürequiresüconsiderationüofütheücomponent'süinterfaces. Architectureüisütoübeüstatedüinütermsüofüinterfacesüratherüthanücomponentüimplementations.üInücontrast,üifüarchitectureüwouldübeüseenüjustüasüdesignüpatternsüforücomposition, aüconcreteüarchitectureümayünotübeürealizableübecauseütheücomponentsüatühandümayünot tütogetherü(architecturalümismatch).üOnütheüotherühand,üinüaügivenüarchitecture,ücomponentsüareüreplaceableübyüothersüimplementingütheüsameüinterface.üThus,üarchitecture representsü theü longerü lastingü andü slowerü changingü designü asü opposedü toü component implementations.üMoreüprecisely,üanüarchitectureüconsistsüofüaücollectionüofüinterfaces thatürepresentüslotsütoübeülledü(orürolesütoübeüplayed)übyücomponents.üSomeüsupporting white-boxüimplementation,üforüinstance,üaükernel,ümayübeübundledüwithüaügivenüarchitecture. Non-Functionalü Requirements:ü Examplesü ofü systemsü currentlyü underü constructionü wereü collectedü togetherü withü theirü specicü non-functionalü requirements.ü For instance,üanüavionicsüsystemüthatüplansütrajectoriesüofüaüplaneüandümustüreactütoüroute problemsü (suchü asü aü stormü orü beingü lowü onü fuel)ü mustü beü fastü (2-3ü secondü response time)üandümustüadaptüitselfütoümanyüdifferentüsituationsüthatümightüarise.üSecondly,üa systemüforünumericalücomputingüonüparallelüprocessorsümustürunüfastüonüaügivenüparallelümachine.üItüalsoümustübeüquicklyüportableütoürunüonüaünewümachine.üThirdly,üsoftwareü forü controllingü aü kidneyü dialysisü machineü mustü beü responsiveü (quicklyü read variousüsensorsüandüupdatesüactuators),üexibleü(toüadaptüeasyüandüreliablyütoüchanges inühardware,üsuchüasüaünewüpumpümodel,üorümedicalüpractice,üsuchüasüaünewüprotocol forüdialysis),üandüdemonstratableü(toübeüshownütoüaüregulatoryüagencyütoüconvinceüthem ofüitsüsafetyüandübenet).üThereüareüdifferentüwaysüofümeetingünon-functionalürequirements,üdependingüonütheütypeüofürequirement.üSomeüareüautomaticallyüsatisedüifüeach componentüofütheüsystemüisüproperlyüdesigned.üOthersüariseüoutüofütheüinteractionüof components,üandücanüonlyübeüaddressedüatüthatülevel,ünotüatütheülevelüofüindividualücomponents.ü Fourü waysü ofü providingü non-functionalüpropertiesü couldü beüfound.ü Oneü can parameterizeücomponentsüsoüthatüspecicüpropertiesücanübeürequestedüofüthem;üorüone canüreorganizeütheücomponentsütoüdealüwithütheüproperty;üorüoneücanüdesignüanüoverall architectureüthatüisüresponsibleüforütheüpropertyüandüthatücanüprovideüitüifütheücomponentsüadhereütoütheüarchitecture;üor,ünally,üaümeta-levelümechanismücanüprovideüaccess toütheücomponentüinteractionütoüdealüwithütheüproperty.üTheülatterüisüsimilarütoüaspectorientedüprogramming. Glue:ü Byü glue,ü theü participantsü understoodü middlewareü thatü isü usedü toü connect existingü components.ü Examplesü areü Tcl/Tk,ü scriptingü mechanisms,ü evenü makeü les. Someüsupportüforütypingüwouldübeüniceütoühaveübutühardütoüachieveüdueütoütheüvastüvarietyüofütypesücomponentsümayüintroduce.üInügeneral,ütheüglueüisümoreüexibleüthanüthe componentsü gluedü together,ü andü thusü shouldü useü aü dynamicü language.ü Inü connection withü theü discussionü onü architecture,ü itü turnsü outü thatü componentsü areü sandwiched betweenüarchitectureüandüglue.üToübeüaccessibleüfromüwithinüaügivenüscriptingüenvironment,ütheücomponentsümustümeetüsomeüarchitecturalürequirements,ülikeüacceptingümessagesüsentübyütheüscriptüinterpreter.üThus,ütheüscriptü(glue)übuildsüonücomponentsüthatüin turnüareübuiltüforütheüscriptingüarchitecture.
The Renement Calculus Perspective @abo.
We exhibit the benets of using formal methods for constructing and documenting component software. Formal specications provide concise and com encapsulation. Specications using abstract statements scale up better than prepostconditions and allow for ‘relative’ specications because they may refer to other components. Nondeterminism in specications permits enhancements and alternate implementations. A formally veriable renement relationship between specication and implementation of a component ensures compliance with the published specication. Unambiguous and complete contracts are the foundation
The separation of specications/interfaces and implementations of components is a pre specication. Overspecication basically prohibits future enhancements and alternate implementations. Furthermore, separate specications enable the component integrator The lack of easily and quickly understandable, concise, and complete specications is the chief reason, why the advantages of the separation between specications and ents which is usually given as incomplete, ambiguous, partly overspecic, and often mysterious errors. Overspecication unnecessarily restricts future enhancements. Incompleteness, ambiguity, and overspecication hinder alternate implementations — the Formal specications can solve these problems. The creator of a component can test, whether based solely on the specication the component may be appropriately
behavioral specication.
used. Ambiguities can be detected by consistency proofs. Overspecication can more easily be detected in a concise formal language. Formal verication, here in the form of renement proofs, guarantees that the implementation actually behaves as specied. Furthermore, a specication which is created before the component is implemented, efcient components and often also helps to save costs. The adaptation of formal specications has been slow because of difcult notations which differ too much from Section 2 makes a plea for formal specications as contracts, Sect. 3 shows why nondeterminism is also relevant for practitioners. Renement between specications and implementations to ensure compliance and renement between different versions of a specications are the topics of Sect. 4. Section 5 points to related work and Sect. 6
able specication in form of a VHDL program. They describe all relevant information and error to nd out how the component must be used. He relies on testing of a few cases as the only way to gain condence. Nobody and nothing guarantee that he uses compared to hardware, the immaturity of the eld, the difculties in automated verication, and the — partly unnecessary — complexity and ill-denedness of common programming languages, which further complicates verication. reuse specication error. A poorly documented limitation in a component originally de
these runtime checks are often removed from the nal version for efciency reasons. A Because of the deciencies of run-time only checking, programmers are not inclined to use specications at all. the wheel afresh for each method, rather than being able to build upon other specications. Specications in form of abstract statements are not affected by this scalability problem. Consider the partial specication of component have to expand the denition of the base type of disadvantages. The specication of how with a more deterministic specication. Prepostcondition specications contradict encapsulation and specialization. Specications by abstract statements come close to contracts as proposed by Helm Changes to the specication of the ing nondeterminism, are not automatically reected in the specication of postconditions do not support ‘relative’ specications in the sense of relying on previous specications. The loss of self-containedness of abstract statement specications can easily be compensated by a specication browser supporting in place expansion or hypertext-like facilities. Abstract statements also lend themselves to grey-box specic The process of writing a formal specication often leads to more generally use anomalies resulting from implementation difculties and lack of overview during implementation can often be detected and eliminated by a specication. For example, the above specication of
. The specication base component which satises a certain contract [1,11]. The component integrator can can ‘shop’ for the desired component at runtime. Formal specications of required and
3 Nondeterminism: Avoiding Overspecication nondeterminism is a fundamental tool for specications to avoid laying down unneces A nondeterministic specication leaves more choice for the implementation, which aged rst implementation, it greatly increases the likelihood that future enhancements and alternate implementations can be made compliant with the specication. The earlier specication of the component Nondeterminism often enhances the comprehensibility of specications because the be acknowledged and specied as such. turns an arbitrary value satisfying the specied precision. Both implementations are no way be inuenced from the outside. Writing a combined specication consisting of the rules of which are given by the specication [2]. Demonic choices are moves made bined specication is correct, if we can make moves such that we can achieve the desired goal, no matter what the opponent does. Hence, such a combined specication can
4 Renement: Ensuring Compliance with Specication Employing formal specications, we want to make sure that the implementation actually complies with its specication or, more precisely, is a renement thereof [2]. A renes a statement of nondeterminism into account, we formally dene that is rened by
Renement is reexive, transitive, and antisymmetric. Assume that we have specications S1 and S2, where renement relationship holds between two implementations of the same specication. Hence, it is important that clients only rely on properties guaranteed by the specication. Testing cannot uncover reliance on unspecied implementation features, only
Related work includes the Interface Specication Language developed at CSTaR Soft
We have argued that only formal contracts paired with renement can guarantee full Nondeterminism is a necessity for providing freedom of implementation. Renement guarantees that implementations adhere to their specications and that new ver pre-postcondition specications because they allow for external calls.
The paper presented at the workshop (http://www.abo./˜mbuechi/) contains more material on renement and also includes sections on the specication of invariants and temporal properties and on the design of specication languages, which are left out of
Renement Calculus: A Systematic Introduction 5. W. Kozaczynski and J. O. Ning. Concern-driven design for a specication language. In Proceedings of the 8th International Workshop on Software Specication and Design 9. Clemens A. Szyperski and Cuno Pster. Component-oriented programming: WCOP’96 , 1997. http://www.abo./˜mbuechi/. 11. Amy M. Zaremsky and Jeannette M. Wing. Specication matching of software components.
Object-OrientedüReal-TimeüSoftwareüinütheüEuropeanüSpace Agency JorgeüAmadorüMonteverde SoftwareüEngineeringüandüStandardisationüSection ESA-ESTEC Keplerlaanü1ü-ü2200üAGüNoordwijkü-üTheüNetherlands Tel.:ü(31)ü71ü565ü4388 Fax:ü(31)ü71ü565ü5420 E-mail:ü[email protected]
Introduction:üOverviewüofüESAüon-boardüsoftwareüsystems development ESAü on-boardü softwareü isü mostlyü real-timeü andü embedded,ü performingü aü varietyü of tasksütoücontrolüandümonitorütheüfunctioningüofüaüsatellite.üTypically,üitücanübeüdivided intoütheüfollowingücategories: On-boardüDataüHandlingü(OBDH):ümissionücritical,üusuallyühardüreal-time,üwith bothücyclicüandüsporadicüactivities,üwithüdifferentüdeadlinesüandüpriorities. AttitudeüandüOrbitüControlüSoftwareü(AOCS):ümissionücritical,übutüisüusuallyüsoft real-time.üItüisüessentiallyücyclicüsoftware. Payloadüsoftware:üItüisü(usually)ünotümissionücritical,üandüitsüreal-timeüfeatures dependüveryümuchüonütheüspecicücase. Theümajorityüofüon-boardüsoftwareübeingüdevelopedüinüESAüprojectsüisüdesignedüwith theüHOODümethod,üandücodedüinüAda. HOOD1ü (Hierarchicalü Object-Orientedü Design)ü wasü developedü underü ESAü contract, andüisübasedüonüBooch’süOOD.üItüisümainlyüorientedütoütheüdesignüofüembeddedüAda software.üItüprovidesügoodüsupportüforütheüdesignüofüconcurrentüsystems,üalthoughüitüis weakerüonütheümodellingüofüreal-timeüproperties. TheüAdaü RTSü (i.e.ütasking)üisühardlyü used,ü RTü operatingü systemsü beingü preferred.ü It wasü mainlyü dueü toü theü bigü overheadsü (bothü inü performanceü andü memory)ü ofü the commercialüAdaüRTSs,üalthoughüthisüsituationühasüchangedü(betterüRTSsüandüalsoüthe introductionüofütheüATACüchip,üwhichüprovidesüAdaütaskingüsupportüonüchipülevel). Resourceübudgetsühaveütoübeüdenedüandüadheredütoüthroughoutütheüproject,ühowever, validationüofüreal-timeü(andüinügeneral,ünonüfunctional)ürequirementsüisüusuallyüdoneüat testing,üwithülittleüorünoüeffortüinütheüearlyüphases.
R&Düforüon-boardüsoftware:üOORTütechnology Obviously,ütheüsituationüpresentedüaboveüleadsütoühighüdevelopmentücostsüandühighürisk inü ESA’sü projects.ü Therefore,ü aü numberü ofü R&Dü activitiesü haveü beenü andü areü being carriedüoutütoüimproveüthatüsituation. Asüitüwasüseenüthatüreal-timeürequirementsüwereünotümodelledünorüvalidatedüproperly duringütheüearlyüdevelopmentüphases,üexplicitüactionsüwereütakenüatübothümethodüand toolü level,ü toü provideü aü comprehensiveü setü ofü techniquesü andü toolsü forü real-time embeddedüsoftwareüdevelopmentüandüearlyüvalidation.üThisüwasüdoneüinütheüframeüof OOütechniquesüwhichüwereüalreadyüinüuseü(i.e.üHOOD). Theüfollowingüisüaüsummaryüofütheümostürelevantüresults. HRT-HOOD2ü(‘93) Itü isü anü extensionü toü theü HOODü methodü speciallyü wellü suitedü forü hardü real-time systems.üItüprovides: explicitürecognitionüofütheütypesüofütypicalühardüreal-timeüsystems’üactivitiesü(i.e. cyclic,üsporadic,üresourceümonitors), theüintegrationüofüschedulingüparadigmsüinütheüdesignüprocess, explicitüdenitionüofütheüapplication’sütimingürequirementsüandücriticalityüforüeach activity, decompositionütoüaüsoftwareüarchitectureüthatüeasilyüallowütheüprocessorüallocation, schedulabilityüandütimingüanalysis, facilitiesüandütoolsütoüallowüstaticüvericationüofüreal-timeüpropertiesüearlyüinüthe designüprocess. HRT-HOODü supportsü computationalü modelsü thatü allow:ü co-existenceü ofü bothü cyclic andüsporadicüactivities,üinteractionsübetweenüconcurrentüactivities,üaüblockingüapproach suitableü toü avoidü unboundedü delaysü andü preventü priorityü inversions,ü off-line schedulabilityüanalysis.üAlthoughüitüisüopenütoüanyüschedulingümodel,üworkühasüfocused onütheüRMSüandüDMSüalgorithms.üTheüHRT-HOODümethodüextendsüHOOD’süobject modelü(whichühasüPassiveüandüActiveüobjectsüasütheümainübuildingüblocks)ütoüinclude Protected,ü Sporadicü andü Cyclicü objects,ü andü denesü rulesü forü theirü usage.ü Aü formal mappingütoüAda95,üallowingüautomaticücodeügeneration,üisüalsoüdened. HRT-HOODüprovidesü aüveryügoodü integrationü ofüstate-of-the-artütechniquesüforü realtimeüsystemsüdesignüandüvalidationü(e.g.üDMS)üwithüanüindustrialüdesignümethod,üand thatüwithoutüimposingüaügivenücomputationalümodel.üThatüisüaüstrengthüofüHRT-HOOD comparedü toü otherü methodsü likeü ROOM,ü whichü imposesü aü reactiveü computational model. Onü theü otherü hand,ü HOODü andü HRT-HOODü provideü aü clearü separationü betweenü an object’süinterfaceü(itsüoperationsüandütheücallingüconstraintsüonüitsüoperations)üandüits internalsü (i.e.ü attributesü andü operationsü implementation).ü Thisü allowsü toü performü the
real-timeü analysesü basedü onlyü onü theü objects’ü interfaces,ü asü wellü asü automaticü code generationüforüthoseü(validated)üinterfaces. 3(‘96) HRTüSupportüTools
AüsetüofütoolsüsupportingütheüHRT-HOODümethodüandütheüoff-lineüstaticüvericationüof hardüreal-timeüpropertiesühaveübeenüdenedüandüproduced: WorstüCaseüExecutionüTimeü(WCET)üanalyser:üitüisüintegratedüwithüanüAdaücompilerü(Aonix’süAdaWorld)üforüESA’süSPARCüprocessorsü(ERC32) SchedulabilityüAnalyser,üandüSchedulabilityüSimulator,üfreewareüavailableüfrom Spacebel,üinüBelgium. HRT-HOODütool4:üitüisüanüextensionüofüanüexistingüHOODütoolütoüsupportütheüHRTHOODümethod.üItüalsoüintegratesütheüthreeütoolsüdenedüabove,üprovidingüaücompleteüandüintegratedüenvironmentüforüHRTüsystemsüdesign.üItüalsoügeneratesüAda95 codeüautomaticallyüoutüofütheüveriedüsystem.
Implementationüexperience:ütheüEuropeanüRoboticüArmü(ERA) ERAü isü intendedü toü beü usedü inü theü constructionü ofü theü Russianü segmentü ofü the Internationalü Spaceü Stationü Alpha.ü Theü ERAü projectü selectedü HRT-HOODü asü the designümethodüforütheüERAüControlüComputerü(ECC)üSoftware.üItüisübeingüwrittenüin Adaüwithüanüestimatedüsizeüofü60000üSLOC.üItüisüaühardüreal-timeüsystem,üwithüaround 30üconcurrentüobjectsü (includingü cyclic,ü sporadicüandüprotectedüobjects).ü Itühasüthree mainücomponents,üdevelopedübyüthreeüindependentücompanies,üoneüthemücentralising theüreal-timeüvericationüactivitiesü(i.e.üschedulabilityüanalysis)üofütheüwholeüsystem. Itsüdevelopmentüfollowsüanüincrementalüapproach,üwithü4üconsecutiveüversions,üwhere theüphysicalüarchitectureüandüaüminimalüfunctionalityüisüxedüinüV0,üincludingütheürealtimeüfeasibilityüverication,üandüfurtherüversionsüaddümoreüfunctionalityütoüthatüxed structure.üThisüapproachüisüpossibleüthanksütoüHRT-HOOD’süclearüdistinctionübetween theüobject’süinterfaceüandüimplementation,üdescribedüabove. Theüearlyüvericationüapproachüforüreal-timeühasübeenü(andüis)üofügreatühelpütoütheüECC SWü development.ü Itü hasü allowedü toü assessü howü changesü bothü inü theü real-time requirementsüandüinütheüexecutionüenvironmentü(includingüaüchangeüinütheüprocessor) impactedütheüdesign,üandüthatüinüaüminimumüamountüofütimeü(usuallyülessüthanühalfüa day).
Currentüandüfutureüdirections Reusableüon-boardüreal-timeüsoftwareücomponents SpaceüsoftwareüarchitecturesüatüESAüareüveryüsimilarübetweenümissions.üItüisüclearüthat reusableücomponentsüareünotüonlyücode,übutüalsoüdesignüandüanalysisüobjects.üTheümain problemü nowü isü theü reuseü granularity.ü Althoughü genericü architecturesü lookü very promisingüfromüaü‘static’üpointüofüview,üitüisüveryüdifcultütoüincludeüdynamicüaspects,
speciallyü real-timeü inü suchü architecturesü inü aü genericü way.ü Itü isü preferredü toü have librariesü ofü smallü componentsü withü wellü denedü staticü andü dynamicü (includingü realtime)üproperties,üwhichücanüthenübeücombinedütoübuildütheünalüsystem.üTheüuseüofüfull OOPüfeaturesülikeüinheritanceüandüdynamicübindingüisüconsideredüaükeyüfeatureüforüthe extensibilityü andü adaptabilityü ofü thoseü componentsü toü changingü requirements,ü andü is currentlyüunderüinvestigation. IntegrationüofüHRT-HOODüandüFormalümethods Formalümethodsüareüseenüasüanüexcellentütoolüforüfunctionalürequirementsüspecication andüvalidation,übutünotüsoümuchüforüreal-timeürequirements,üwhereüspecicütechniques areüavailableü(e.g.üDMSütheory).üTheüintegrationüofüformalümethodsüandütoolsü(SDL) forü functionalü requirementsü specicationü withü HRT-HOODü technologyü forü real-time designüisücurrentlyüunderüdevelopment.
References 1. HOODüTechnicalüGroup,ü“HOODüReferenceüManualüreleaseü4”,üSeptemberü1995. 2. “HRT-HOODü--üAüStructuredüDesignüMethodüforüHRTüAdaüSystems”,üReference ManualüVersionü2.0üUniversityüofüYork,üSeptemberü1993. 3. T.üVardanega,ü“ToolüSupportüforütheüConstructionüofüStaticallyüAnalysableüHard Real-TimeüSystemsüinüAda”,üProceedingsüofütheü17thüReal-TimeüSystemsüSymposium,üIEEE,üDecemberü1996. 4. “HRT-HoodNICE:üAüHardüReal-TimeüSoftwareüdesignüSupportüTool”,üFinal Report,üESTECüContractüNo.ü11234/94/NL/FM(SC),üIntecsüSistemi,üMarchü1996.