UML for Java Programmers Object Mentor, Inc. Copyright  1998-2001 by Object Mentor, Inc All Rights Reserved www.objectmentor.com www.junit.orgwww.xprogramming.comfitnesse.org.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Chapter 6: Behavioral Modeling
Introduction to Software Engineering 7. Modeling Behaviour.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Software Engineering COMP 201
Systems Analysis and Design in a Changing World, Fourth Edition
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Component and Deployment Diagrams
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
SE-565 Software System Requirements More UML Diagrams.
Chapter 3 : Software Process and Other Models Juthawut Chantharamalee Curriculum of Computer Science Faculty of Science and Technology, Suan Dusit University.
Object-oriented design Part 4: More UML. Interfaces An interface is a language construct specific to Java Java does not support multiple inheritance Interfaces.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Unified Modeling Language
Unified Modeling Language
Object-Oriented Analysis and Design
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
程建群 博士(Dr. Jason Cheng) 年03月
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Chapter 16 Applying UML and Patterns Craig Larman
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Drawing System Sequence Diagrams
Object Oriented Software Development
1 Kyung Hee University Diagram Editor : Design View Spring 2001.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Systems Analysis and Design in a Changing World, Fourth Edition
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
Chapter 3 Class Diagrams. 2 Outline Class Basics Class Basics Classes Classes Association Association Multiplicity Multiplicity Inheritance Inheritance.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 3: Introducing the UML
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
1 Kyung Hee University Interaction Diagrams Spring 2001.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Chapter 1 Overview of UML for Java Programmers. 2 Outline Diagram Types Diagram Types Class Diagrams Class Diagrams Object Diagrams Object Diagrams Sequence.
Systems Analysis and Design in a Changing World, Fourth Edition
UML Diagrams By Daniel Damaris Novarianto S..
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Sequence Diagram.
UML Diagrams Jung Woo.
Classification of UML Diagrams
IMAT5205 Systems Analysis and Design
Week 12: Activity & Sequence Diagrams
Introduction to Unified Modeling Language (UML)
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Unified Modelling Language
Sylnovie Merchant, Ph.D. MIS 161 Spring 2005
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

UML for Java Programmers Object Mentor, Inc. Copyright  by Object Mentor, Inc All Rights Reserved Or How Uncle Bob uses UML.

2 The three modes of UML Conceptual Tied to human language. Specification A description of source code yet to be written. Implementation A description of source code that already exists.

3 Conceptual Tied to human language: “An Animal ISA Dog”

4 Hmmm…

5 Tied to human language

6 Models of the “Real World” Do not relate to software structure. Now it’s time for: Uncle Bob’s rant…. Human language is not the best foundation for software structure. A Circle ISA Ellipse.

7 A Circle ISA Ellipse

8 Specification and Implementation Are tied to code. Follow the same rules. Differ only in detail. Sometimes.

9 Example: public class TreeMap { TreeMapNode topNode = null; public void add(Comparable key, Object value) {…} public Object get(Comparable key) {…} } class TreeMapNode { private Comparable itsKey; private Object itsValue; private TreeMapNode nodes[] = new TreeMapNode[2]; public TreeMapNode(Comparable key, Object value) {…} public Object find(Comparable key) {…} public void add(Comparable key, Object value) {…} }

10 Here’s some UML for that.

11 Classes and Relationships. Rectangles represent classes, and arrows represent relationships.

12 Associations. In this diagram all the relationships are associations. Associations are simple data relationships in which one object holds a reference to, and invokes methods upon, the other.

13 Relationship Names. The name on an association maps to the name of the variable that holds the reference. public class TreeMap { TreeMapNode topNode = null; }

14 Multiplicity. A number next to an arrowhead typically shows the number of instances held by the relationship. If that number is greater than one then some kind of container, like an array, is implied. class TreeMapNode { private TreeMapNode nodes[] = new TreeMapNode[2]; }

15 Class Icons. Class icons can have more than one compartment. The top compartment always holds the name of the class. The other compartments describe functions and variables.

16 Interface. The «interface» notation means that Comparable is an interface.

17 Optional. Most of the notations shown are optional Uncle Bob is going to rant again…

18 >. But Uncle Bob, you didn’t talk about Aggregation or Composition. Rant….

19 Object Diagrams.

20 Freeze Frame. It shows a set of objects and relationships at a particular moment in the execution of the system. You can view it as a snapshot of memory.

21 Object Names are Underlined. the rectangle icons represent objects. You can tell that they are objects because their names are underlined.

22 Object : Class The name after the colon is the name of the class that the object belongs to.

23 Values. Note that the lower compartment of each object shows the value of that object’s itsKey variable.

24 Links. The relationships between the objects are called links, and are derived from the associations.

25 Sequence Diagrams. public void add(Comparable key,Object value){ if (topNode == null) topNode = new TreeMapNode(key, value); else topNode.add(key, value); }

26 Actor. The stick figure (actor) represents an unknown caller.

27 Lifelines. The dashed lines are lifelines, they show the lifetime of the objects they descend from.

28 Messages. The long arrows are messages sent between the objects.

29 Guards. The boolean expressions inside square brackets are called guards. They show which path is taken.

30 Construction. The message arrow that terminates on the TreeMapNode icon represents construction.

31 Data Tokens The little arrows with circles are called data tokens. They show any arguments or return values.

32 Activations. The skinny rectangle below TreeMap is called an activation. It depicts how much time the add method executes.

33 Collaboration Diagrams.

34 Same data as Sequence Diagrams. Collaboration diagrams make the relationships between the objects clear.

35 Links (again). The objects are connected by relationships called links. A link exists wherever one object can send a message to another.

36 Messages. Traveling over those links are the messages themselves. They are depicted as the smaller arrows.

37 Message Labels. The messages are labeled with the name of the message, its sequence number, and any guards that apply.

38 Sequence Numbers. The dot structure of the sequence number shows the calling hierarchy.

39 State Diagrams. A Subway Turnstile.

40 States. There are two states named Locked and Unlocked.

41 Events. Two events may be sent to the machine. The coin event means that the user has dropped a coin into the turnstile. The pass event means that the user has passed through the turnstile.

42 Transitions. The arrows are called transitions. They are labeled with the event that triggers the transition and the action that the transition performs.

43 Interpretation. If we are in the Locked state and we get a coin event, then we transition to the Unlocked state and we invoke the Unlock function. If we are in the Unlocked state and we get a pass event, then we transition to the Locked state and we invoke the Lock function. If we are in the Unlocked state and we get a coin event, then we stay in the Unlocked state and we call the Thankyou function. If we are in the Locked state and we get a pass event, then we stay in the Locked state and we call the Alarm function.

44 Sufficiency. The diagrams shown in this chapter are enough for most purposes. Most programmers could live without any more knowledge of UML that what is shown here.

45 Tools. Now ask me what I think about tools…..

46 Documentation.

47 Where to get this presentation.