UML Java Programmers

UML Java Programmers

UML for Java Programmers Robert Cecil Martin Object Mentor Inc. Prentice Hall, Englewood Cliffs, New Jersey 07632 Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’t Panic Don’tPanicDon’tPanicDon’tPanicDon’tPanic Martin, Robert Cecil. The Principles, Practices, & Patterns of Agile Software Development /Robert Cecil Martin. p. cm. “An Alan R. Apt Book.” Includes index. ISBNxxxxxxxxx Publisher: Alan Apt Production Editor: Cover Designer: Copy Editor: © 2002 by Prentice-Hall, Inc. A Simon & Schuster Company The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and pro- grams to determine their effectiveness. The author and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs. All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. PrintedintheUnitedStatesofAmerica 10987654321 ISBN 0-13-203837-4 PRENTICE-HALL INTERNATIONAL (UK) Limited, London PRENTICE-HALL OF AUSTRALIA PTY.LIMITED, Sydney PRENTICE-HALL CANADA,INC., Toronto PRENTICE-HALL HISPANOAMERICANA, S.A., Mexico PRENTICE-HALL OF INDIA PRIVATE LIMITED, New Delhi PRENTICE-HALL OF JAPAN,INC., Tokyo SIMON &SCHUSTER ASIA PTE.LTD., Singapore EDITORA PRENTICE-HALL DO BRASIL,LTDA., Rio de Janeiro This book is dedicated to my grandchildren: XXX: the son of Micah and Angelique. Alexis: the daughter of Angela and Matt. It has been said that grandchildren are the desert of life. If that’s so, what am I supposed to do with all the many main courses I’m not done with yet? Source Code and Contact Information: Much of the source code presented in this book can be obtained from the Object Mentor Inc. web site. www.objectmentor.com/UMLFJP Robert C. Martin: [email protected] Object Mentor Inc.: [email protected] www.objectmentor.com i Chapter : Chapter 1: Overview of UML for Java Programmers ..................................1 Diagram Types ......................................................................................2 Class Diagrams...................................................................................4 Object Diagrams.................................................................................5 Sequence Diagrams ............................................................................6 Collaboration Diagrams .....................................................................6 State Diagrams ...................................................................................7 Conclusion..............................................................................................8 Bibliography ..........................................................................................8 Chapter 2: Working with Diagrams ....................................................................9 Why Model?...........................................................................................9 Why build models of software? .......................................................10 Why should we build comprehensive designs before coding? ........10 Making Effective use of UML ............................................................10 Communicating with Others. ...........................................................11 Back end Documentation .................................................................13 What to keep, and What to throw away. ..........................................14 Iterative Refinement ...........................................................................15 Behavior first....................................................................................15 Check the structure...........................................................................17 Envisioning the code. .......................................................................19 Iterative Refinement.........................................................................20 Minimalism ..........................................................................................21 When and how to draw diagrams......................................................21 When to draw diagrams, and when to stop. .....................................21 CASE Tools......................................................................................22 But what about documentation?.......................................................23 And Javadocs?..................................................................................23 Conclusion............................................................................................24 Chapter 3: Class Diagrams ...................................................................................25 ii The Basics ............................................................................................25 Classes..............................................................................................25 Association.......................................................................................26 Multiplicity.......................................................................................26 Inheritance........................................................................................27 An Example Class Diagram ...............................................................28 The Details ...........................................................................................30 Class Stereotypes..............................................................................30 Abstract classes ................................................................................31 Properties..........................................................................................31 Aggregation......................................................................................32 Composition .....................................................................................33 Multiplicity.......................................................................................34 Association Stereotypes ...................................................................35 Inner Classes ....................................................................................36 Anonymous Inner Classes................................................................36 Association classes...........................................................................37 Association Qualifiers......................................................................38 Conclusion............................................................................................38 Bibliography ........................................................................................39 Chapter 4: Sequence Diagrams ...........................................................................41 The Basics ............................................................................................41 Objects, Lifelines, Messages, and other odds and ends. ..................41 Creation and Destruction..................................................................43 Simple Loops....................................................................................44 Cases and Scenarios .........................................................................44 Advanced Concepts.............................................................................48 Loops and Conditions.......................................................................48 Messages that take time....................................................................49 Asynchronous Messages. .................................................................51 Multiple Threads ..............................................................................53 Active Objects..................................................................................54 Sending Messages to Interfaces. ......................................................54 Conclusion............................................................................................56 iii Chapter : Chapter 5: Use Cases ...............................................................................................57 Writing Use Cases ...............................................................................57 What is a use case.............................................................................58 The Primary Course .........................................................................58 Alternate Courses .............................................................................59 What else? ........................................................................................59 Use Cases Diagrams ............................................................................60 System Boundary Diagram ..............................................................60 Use Case Relationships ....................................................................61 Conclusion............................................................................................61 Chapter 6: Principles of OOD ..............................................................................63

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    247 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us