ebook img

Inheritance Relationships for Disciplined Software Construction PDF

210 Pages·2002·6.81 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Inheritance Relationships for Disciplined Software Construction

Distinguished Dissertations Springer-V erlag London Ltd. OthertitlespublishedinthisSeries: ExtensionalConstructsinIntensionalTypeTheory MartinHoffman SearchandPlanningUnderIncompleteInformation:AStudyUsingBridgeCardPlay IanFrank TheoremProvingwiththeRealNumbers John Harrison GamesandFullAbstractionforaFunctionalMetalanguagewithRecursiveTypes GuyMcCusker HardwareEvolution:AutomaticDesignofElectronicCircuitsinReconfigurableHardware byArtificialEvolution AdrianThompson ModelsofSharingGraphs:ACategoricalSemanticsofletandletrec MasahitoHasegawa LargeScaleCollaborativeVirtualEnvironments ChrisGreenhalgh Architecture-IndepentLoopParallelisation RaduC.Calinescu RandomizedAlgorithms:Approximation,GenerationandCounting RussBubley User-DeveloperCoooperationinSoftwareDevelopment EamonnO'Neil ACombinationofGeometryTheoremProvingandNonstandardAnalysis,with ApplicationtoNewton'sPrincipia JacquesFleuriot AccurateVisualMetrologyfromSingleandMultipleUncalibratedImages AntonioCriminisi Tracy A. Gardner Inheritance Relationships for Disciplined Software Construction i Springer Tracy A. Gardner, PhD UniversityofBath, Bath, BA2 7AY, UK Series Editor Professor C.T. van Rijsbergen Department of Computing Science, University of Glasgow, G12 8RZ, UK British Library Cataloguing in Publication Data Gardner, Tracy A. Inheritance re1ationships for disciplined software construction. -(Distinguished dissertations) 1. Computer software -Development 2. Object-oriented methods (Computer science) 1. Tide 005.1 ISBN 978-1-4471-1092-7 Library of Congress Cataloging-in-Publication Data Gardner, Tracy A., 1972- Inheritance relationships for disciplined software construction I Tracy A. Gardner. p. cm. - (Distinguished dissertations) Includes bibliographical references and index. ISBN 978-1-4471-1092-7 ISBN 978-1-4471-0121-5 (eBook) DOI 10.1007/978-1-4471-0121-5 1. Object-oriented methods (Computer science) 2. Software engineering. 1. Tide. II. Distinguished dissertations (Springer-Verlag) QA76.9.035 G368 2001 005.1'17-dc21 2001020905 Apart from any fair dea1ing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licences issued by the Copyright Licensing Agency. Enquiries concerning reproduction outside those terms shou1d be sent to the publishers. Distinguished Dissertations ISSN 1439-9768 ISBN 978-1-4471-1092-7 http://www.springer.co.u1c © Springer-Verlag London 2002 Origina11y published by Springer-Verlag London Limited in 2002 Softcover reprint ofthe hardcover 1s t edition 2002 The use of registered names, trademarks etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant laws and regulations and therefore free for general use. The publisher makes no representation, express or implied, with regard to the accuracy of the information contained in this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made. Typesetting: Camera-ready by author 34/3830-543210 Printed on acid-free paper SPIN 10830677 Preface Object-oriented inheritance has been in widespread use for a decade; it is now realised that although inheritance is a powerful modelling tool with many associated advantages, its benefits are not automatically conferred on systems that simply use it. In order to lead to readily understandable, easily maintainable systems with high levels of reuse, inheritance must be used well. This situation is further complicated by having multiple appli cationsofinheritance that are considered to be valid modelling techniques. Although there are many guidelines pertaining to the use of inheritance, advice that is suitable for one form of inheritance may not be applicable to another. Inheritance, as currently available, is a difficult technique to master. In this book, we develop a model of inheritance based around five fun damental inheritance relationships. Each relationship has a clear concep tual basis, representing a fundamental, specialised use of inheritance, the relationships - specialisation, variant, view, construction and evolution can be used individually, or combined to achieve complex inheritance rela tionships.These fiverelationships are referred to as structured inheritance relationships (SIRs) since they introduce understandable and maintainable abstraction hierarchies rather than the 'spaghetti' inheritance hierarchies that result from using the same overloaded notion of inheritance to repre sent a number of underlying conceptual relationships. The fiveSIRs are based on current uses ofinheritance that have a sound conceptual basis, the underlying conceptual relationships are considered outside the restrictive context of current programming-language inheri tance mechanisms and a detailed semantics is developed for each of the v VI SIRs by considering the natural extension of these conceptual relation ships. The resulting SIR model of inheritance replaces a confused notion of inheritance with fivedistinct conceptual relationships, supporting more precise modelling ofsystems and capturingthe semantic intent ofeach use ofinheritance within a system. Acknowledgements Without my valuable placement year (1993-1994) spent at Intera Infor mation Technologies Ltd (now Enviros) it is unlikely that I would have embarked upon a PhD at all; it was during that year that I was first intro duced to the object-oriented paradigm in depth. My colleagues there, in particular Dr Peter Robinson, Dr MikeWilliams and Dr John Woods, pro vided a stimulatingworking environment in which tqe current wayofdoing things was never accepted by default and challenges to existing thinking were encouraged. I would also like to acknowledge numerous fellow conference attendees at ECOOP '97 (especially the members ofthe PhDOOS workshop); OOP SLA '97 (especially the members the Doctoral Symposium); and Object Technology '97 and '98. The chance to discuss ideas with both researchers and practitioners at these events contributed markedly to the maturity of my research. I would like to thank my supervisor Dr Claire Willis for her encour agement and motivation throughout my PhD. She kept me on track and provided detailed comments on successive versions of this work. I am greatly indebted to Dr Kevin Rutherford who has offered detailed criticism of my work, from both a theoretical and a practical perspective, on numerous occasions. Kevin has also provided much-appreciated con structive advice and encouragement regarding the process of completing a PhD. Thanks to Dr Nic Doye for casting his mathematical eye over my work and providing valuable observations and suggestions. Over the years, Nic viii has always willingly answered my questions (some of them repeatedly, I'm sure). Cheers Nic. A general thankyou goes out to my family, friends and colleagues who have always had confidence that I would get to the end of this, even when I wasn't so sure. I'd also like to thank the developers of Linux, Jt.1EX, emacs and all of the other free software that has made working on my PhD a much more pleasurable experience that it might otherwise have been. Thanks to Lucinda Williams and Jimmy Dale Gilmore for keeping me company and getting me through the final stages of writing up - even if you didn't know you were doing it. Finally, I would liketo thank my partner Beanz.! He has provided prac tical help, emotional support, and when all else failed, chocolate, and has helped me to keep things in perspective. Thanks Beanz, you are appreci ated. 1Don't ask! Contents 1 Introduction 1 1.1 Objectives and limitations 2 1.2 Approach . . 3 1.3 Conventions . 3 1.4 Outline . . . 5 2 Current understanding ofinheritance 9 2.1 The origin of inheritance. 9 2.2 What is inheritance? ... 13 2.3 Advantages of inheritance 16 2.4 Problems with inheritance 19 2.5 Understanding inheritance . 25 2.6 Conclusion . 34 3 Structured inheritance relationships (SIRs) 37 3.1 Context and scope . 38 3.2 Variant . 40 3.2.1 Using variant as a modelling tool 42 3.2.2 Variant subrelationships . . . . 43 3.3 View . 44 3.3.1 Using viewas a modelling tool 45 3.3.2 Viewsubrelationships . . . . . 46 3.4 Evolution . . . . .. ...... ... . . 47 3.4.1 Using evolution as a modelling tool 49 ix x Contents 3.4.2 Evolutionsubrelationships . . . . . . . 49 3.5 Construction ..... ... . . . .. . . . . . . 51 3.5.1 Using construction as a modelling tool 52 3.5.2 Construction subrelationships . . . . . 53 3.6 Specialisation . 54 3.6.1 Using specialisation as a modelling tool. 55 3.6.2 Specialisation subrelationships . 56 3.7 Conclusion . 57 4 A new model ofinheritance 59 4.1 Underlying model . . . . . . . . . . . . . . . 59 4.1.1 The SIR notion of types and classes 59 4.1.2 Methods in the SIR model . 61 4.2 Presentation of the SIR model 64 4.2.1 Types and classes . . . . . . . . . . . 64 4.2.2 Representing the SIRs in the UML meta-model 65 4.2.3 Notation . . . . .. . . .. .. .... 66 4.3 SIR 66 4.3.1 Semantics of the SIR model element 66 4.4 SIR Specialisation . . . . . . . . . . . . 68 4.4.1 Semantics of SIR specialisation 72 4.5 SIR Variant . . . . . . . . . . . 73 4.5.1 Semantics of SIR variant. . . 76 4.6 SIR Construction . . . . . . . . . . . 77 4.6.1 Semantics of SIR construction 82 4.7 SIR View 83 4.7.1 Semantics of SIR view . . . 88 4.8 SIR Evolution . . . . . . . . . . . . 90 4.8.1 Semantics of SIR evolution . 93 4.9 Multiple inheritance in the SIR model 94 4.9.1 Homogeneous multiple inheritance 95 4.9.2 Heterogeneous multiple inheritance . 98 4.10 Relationship with other work 101 4.11 Conclusions . . . . . . . . . . . . . . . . . . 105 5 Techniques for structured use ofinheritance 107 5.1 Required architectural qualities . . . . . . . . 107 5.2 Planning techniques . . . . . . . . . . . . . . 110 5.2.1 Selecting features for a new abstraction 110 5.2.2 Reusability ofclients . . . . . . . . . . . 112 5.2.3 Separation ofreusable implementation from variants 113 5.3 Variability techniques 115 5.3.1 Construction-time variant selection . 115 5.3.2 State-based abstractions . . . 116 5.3.3 Dynamic realization variation . . . . 118

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.