Chapter 16 UML Class Diagrams.

Slides:



Advertisements
Similar presentations
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Advertisements

© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Architectural Modeling Notations.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
Chapter 16. Fig Fig Note: If Sale references nothing then the only thing it is associated with is what references it Note: association name.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1.
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
DOMAIN MODE: ASSOCIATIONS, MULTIPLICITY AND ATTRIBUTE-TEXT NOTATION SYS466.
Object-Oriented Analysis and Design Feb 25, 2009.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
© 2005 Prentice Hall9-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Domain Model—Part 3: Associations, Multiplicity and Attribute- Text Notation.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML Class Diagrams.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
1 Introduction to Classes and Objects Chapter 3 Introduction to Classes and Objects Chapter 3.
Object-Oriented Analysis and Design Feb 11, 2009.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Domain Model—Part 2: Attributes.  A logical data value of an object  (Text, p. 158)  In a domain model, attributes and their data types should be simple,
COP3502 Programming Fundamentals for CIS Majors 1 Instructor: Parisa Rashidi.
Chapter 3 Class Diagrams. 2 Outline Class Basics Class Basics Classes Classes Association Association Multiplicity Multiplicity Inheritance Inheritance.
Chapter 16: UML Class Diagrams
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
Chapter 16 UML Class Diagrams.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Chapter 3: Introducing the UML
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
Modeling with UML – Class Diagrams
Introduction to Object-oriented Programming
Chapter 9 Domain Models.
UML Class Diagrams (more notation)
Design Class Diagrams
Class Diagram M. Seidl, et al., Introduction to Object-Oriented Modeling, Springer, Chaper 4. Soft copy (pdf) downloadable freely.
M.M. Pickard, PhD A Primer on Use Cases (Reference: UML Superstructure Specification, v2.1.1)
Design Class Diagrams
Object Oriented Analysis and Design
Chapter 3 Introduction to Classes, Objects Methods and Strings
Defining Classes and Methods
Seminar 3 UML Class Diagram.
UML: Unified Modeling Language
UML Class Diagram.
Slides by Steve Armstrong LeTourneau University Longview, TX
CIS 375 Bruce R. Maxim UM-Dearborn
Defining Classes and Methods
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Class Diagram.
Chapter 16 Class Diagrams.
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
Information System Design
The generalization of class
Chapter 11: Class Diagram
Methods Coding in Java Copyright © Curt Hill.
Design Model: Creating Design Class Diagrams
Presentation transcript:

Chapter 16 UML Class Diagrams

Domain Model vs. Design Class Diagram (DCD)

Attribute text vs. association lines

Full format attribute text notation visibility name : type multiplicity = default {property string}

UML Class Diagram Conventions: Domain Models vs. DCDs Arrows: Used in DCDs. Register has currentSale attribute Not used in domain models. DCDs have multiplicities only at target end No role name for DCDs No association name for DCDs

Attribute text vs. association lines Guideline: Attributes should be (simple, primitive) data types Boolean, Date, Number (Integer, Real), String (Text), Time, Phone Number, ID Number, Postal Code, … Non-data type relationships (i.e., class relationships) should be expressed using associations, not attributes. Notational difference only. As far as coding is concerned, they mean the same thing.

Notation at Association Ends Rolename: Association end name Multiplicity Property string

Collection Attributes

Note Symbols: Notes, Comments, Constraints and Method Bodies

Operations (Methods) Full official format visibility name (parameter-list) : return-type {property-string} Can use programming language notation if more convenient and understandable Operations assumed public unless indicated otherwise Property string: Arbitrary info Example: Exceptions that may be raised Operation vs. method Operation: A declaration, the specification of a method Method: Implementation of an operation Access operations (set & get methods) usually excluded from DCD diagrams

<<actor>> <<interface>> {abstract} {ordered} UML Keywords <<actor>> <<interface>> {abstract} {ordered}

Generalization, Abstract Classes, Abstract Operations final class shown by {leaf}

Dependency Reserve its use for purposes other than associations/attributes Examples: Global, parameter variable, local variable and static method dependencies public class Sale { public void updatePriceFor(ProductDescription description) { Money basePrice = description.getPrice(); }

Dependency Example public class Foo { public void doX() { System.runFinalization(); // ... }

Dependency Labels

Interface Notations

Composition Composition: A strong kind of association An instance of Square (“the part”) belongs to only one Board (“the composite instance) at a given time A Square object must always belong to a Board No free-floating parts The Board (composite) is responsible for creating and deleting the parts If composite is destroyed, the parts must also be destroyed or attached to another composite.

Constraints Notation

Qualified Associations Qualifier: Selects an object from a larger set of related objects Based on the qualifier key Suggests looking things up by key e.g. in a hashtable Multiplicity on the association is changed from many to one.

Association Classes The association itself is a class Why: A lot of information needs to be remembered/stored about the association attributes operations

Singleton Classes

Template Classes and Interfaces public class Board { private List<Square> squares = new ArrayList<Square>(); // ... }

User-Defined Compartments

Active Classes Active object: Runs on and controls its own thread of execution

Interaction diagrams help build and debug class Diagrams