logo资料库

Object Oriented Design with UML and Java.pdf

第1页 / 共417页
第2页 / 共417页
第3页 / 共417页
第4页 / 共417页
第5页 / 共417页
第6页 / 共417页
第7页 / 共417页
第8页 / 共417页
资料共417页,剩余部分请下载后查看
Object-Oriented Design with UML and Java
Copyright Page
Contents
Preface
Chapter 1. Object Technology
1.1 Background
1.2 Using the UML
1.3 Classes. sets of similar objects
1.4 Tools
1.5 Summary
1.6 Exercises
Chapter 2. Object-Oriented Analysis and Design
2.1 Fundamentals of an OOAD
2.2 Illustration
2.3 Toward design
2.4 UML diagrams
2.5 Class diagrams
2.6 Summary
2.7 Exercises
Chapter 3. Implementing Objects with Java
3.1 Introduction
3.2 Illustration
3.3 Building an application
3.4 Implementing architectural relationships
3.5 Establishing the architecture
3.6 The example application
3.7 Summary
3.8 Exercises
Chapter 4. Case Study: A Library Application
4.1 Specification
4.2 Iteration 1
4.3 Iteration 2
4.4 Iteration 3
4.5 Summary
4.6 Exercises
Chapter 5. Specialization
5.1 Specialization
5.2 Inherited methods
5.3 Redefined methods
5.4 Polymorphism
5.5 Polymorphism at work
5.6 Protected features
5.7 The abstract class
5.8 The interface class
5.9 The interface at work
5.10 Summary
5.11 Exercises
Chapter 6. Case Study: The Library Application Revisited
6.1 Specification
6.2 Iteration 1
6.3 Iteration 2
6.4 Iteration 3
6.5 Summary
6.6 Exercises
Chapter 7. Graphical User Interfaces
7.1 Overview of Swing
7.2 Rebuilding the library case study
7.3 Events
7.4 Menu bar
7.5 Application menus
7.6 Application buttons
7.7 Dialogs
7.8 Summary
7.9 Exercises
Chapter 8. Design Patterns
8.1 Delegation
8.2 Interface
8.3 Iterator
8.4 Adapter
8.5 Singleton
8.6 Visitor
8.7 Observer
8.8 Template method
8.9 Abstract factory
8.10 Decorator
8.11 Summary
8.12 Exercises
Chapter 9. Case Study: A Final Review
9.1 Refactoring
9.2 Iteration 1
9.3 Iteration 2
9.4 Iteration 3
9.5 Iteration 4
9.6 Summary
9.7 And finally
9.8 Exercises
Bibliography
Appendix A. Setting up the Environment
Appendix B. ROME
Appendix C. Package textio
Appendix D. UML Notation and Java Bindings
Appendix E. The Java Collections Framework
Appendix F. Programming with Java
Appendix G. Object-Oriented Programming with Java
Appendix H. Procedural Code in Java
Index
Object-Oriented Design with UML and Java
To Irene – K.B. To Salwa – J.S.
Object-Oriented Design with UML and Java K. Barclay J. Savage Amsterdam • Boston • Heidelberg • London • New York • Oxford • Paris • San Diego • San Francisco • Singapore • Sydney • Tokyo
Elsevier Butterworth-Heinemann Linacre House, Jordan Hill, Oxford OX2 8DP 200 Wheeler Road, Burlington, MA 01803 First published 2004 Copyright © 2004, Elsevier Ltd. All rights reserved No part of this publication may be reproduced in any material form (including photocopying or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1T 4LP. Applications for the copyright holder’s written permission to reproduce any part of this publication should be addressed to the publisher. Permissions may be sought directly from Elsevier’s Science and Technology Rights Department in Oxford, UK: phone: (⫹44) (0) 1865 843830; fax: (⫹44) (0) 1865 853333; e-mail: permissions@elsevier.co.uk. You may also complete your request on-line via the Elsevier Science homepage (http://www.elsevier.com), by selecting ‘Customer Support’ and then ‘Obtaining Permissions’. British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN 0 7506 6098 8 For information on all Elsevier Butterworth-Heinemann publications visit our website at http://books.elsevier.com Typeset by Charon Tec Pvt. Ltd, Chennai Printed and bound in Great Britain
Contents Preface 1 Object Technology 1.1 Background 1.1.1 Modelling 1.1.2 UML 1.1.3 Analysis and design models 1.1.4 Development process 1.2 Using the UML 1.2.1 Objects: combined services and data 1.2.2 Objects make excellent software modules 1.2.3 Object interaction is expressed as messages 1.3 Classes: sets of similar objects 1.3.1 Specialization 1.3.2 Polymorphism 1.4 Tools 1.5 Summary 1.6 Exercises 2 Object-Oriented Analysis and Design 2.1 Fundamentals of an OOAD 2.1.1 A lightweight process Illustration 2.2.1 Realizing the use-cases 2.2 2.3 Toward design 2.4 UML diagrams 2.4.1 Use-case diagrams 2.4.2 Interaction diagrams 2.4.3 Sequence diagrams 2.4.4 Collaboration diagrams 2.4.5 Activity diagrams 2.5 Class diagrams 2.5.1 Representation of objects 2.5.2 Association of objects 2.5.3 Composite aggregation of objects 2.5.4 Shared aggregation 2.6 Summary 2.7 Exercises v ix 1 2 2 3 3 4 4 5 8 9 10 12 14 16 17 17 19 19 20 23 25 32 33 33 34 34 36 36 38 38 38 42 43 44 45
vi Contents 3 Implementing Objects with Java 3.1 3.2 Introduction Illustration 3.2.1 Mandatory profile 3.3 Building an application 3.4 Implementing architectural relationships 3.4.1 Introduction 3.4.2 The bank problem revisited 3.5 Establishing the architecture 3.5.1 The mandatory profile revisited 3.6 The example application 3.7 Summary 3.8 Exercises 4 Case Study: A Library Application 4.1 Specification 4.2 Iteration 1 4.2.1 Establish use-cases 4.2.2 Analysis 4.2.3 Design 4.2.4 Implementation 4.2.5 Reconcile model diagrams Iteration 2 4.3.1 Establish use-cases 4.3.2 Analysis 4.3.3 Design 4.3.4 Implementation 4.3.5 Reconcile model diagrams Iteration 3 4.4.1 Establish use-cases 4.4.2 Analysis 4.4.3 Design 4.4.4 Implementation 4.4.5 Reconcile model diagrams 4.3 4.4 4.5 Summary 4.6 Exercises 5 Specialization 5.1 Specialization 5.2 Inherited methods 5.3 Redefined methods 5.4 Polymorphism 5.5 Polymorphism at work 5.6 Protected features 5.7 The abstract class 5.8 The interface class 49 49 49 56 57 59 60 60 63 64 65 68 68 73 73 73 74 75 78 83 97 98 98 101 103 103 111 112 112 113 115 117 122 126 127 131 131 133 135 136 146 148 149 153
Contents 5.9 The interface at work 5.10 Summary 5.11 Exercises 6 Case Study: The Library Application Revisited 6.1 Specification 6.2 Iteration 1 6.2.1 Establish use-cases 6.2.2 Analysis 6.2.3 Design 6.2.4 Implementation 6.2.5 Reconcile model diagrams Iteration 2 6.3.1 Establish use-cases 6.3.2 Analysis 6.3.3 Design 6.3.4 Implementation 6.3.5 Reconcile model diagrams 6.3.6 A review of iteration 2 Iteration 3 6.4.1 Establish use-cases 6.4.2 Analysis 6.4.3 Design 6.4.4 Implementation 6.4.5 Testing 6.3 6.4 6.5 Summary 6.6 Exercises 7 Graphical User Interfaces 7.1 Overview of Swing 7.2 Rebuilding the library case study 7.3 Events 7.4 Menu bar 7.4.1 Responding to a menu selection 7.5 Application menus 7.6 Application buttons 7.7 Dialogs 7.8 Summary 7.9 Exercises 8 Design Patterns 8.1 Delegation Interface 8.2 8.3 Iterator 8.4 Adapter 8.5 Singleton vii 157 160 161 167 167 167 168 172 173 175 181 181 182 182 182 185 193 193 197 197 198 199 200 201 202 202 205 205 207 211 216 218 221 230 235 238 238 241 241 250 254 255 257
分享到:
收藏