UML Class Diagrams - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

UML Class Diagrams

Description:

UML Class Diagrams. CS2335. Spring 2005. Miscellaneous. Drawing Software. Dia. Visio, Argo, Poseidon. Rational Rose. From csh in Baird cluster type: ... – PowerPoint PPT presentation

Number of Views:231
Avg rating:3.0/5.0
Slides: 28
Provided by: Robert9
Category:
Tags: uml | argo | class | diagrams

less

Transcript and Presenter's Notes

Title: UML Class Diagrams


1
UML Class Diagrams
  • CS2335
  • Spring 2005

2
Miscellaneous
  • Drawing Software
  • Dia
  • Visio, Argo, Poseidon
  • Rational Rose
  • From csh in Baird cluster type
  • source /usr/local/rational/rs_setup.csh
  • Rose
  • QSEE SuperLite
  • Omondo (http//www.omondo.com/)
  • Hand-drawn and then scanned

3
Agenda
  • Package Diagrams
  • Class Diagrams
  • Symbology
  • Basic Modeling
  • Intermediate Modeling

4
Package Diagrams
  • Show basic package structure
  • represents packages or namespaces
  • Each classname in a package must be unique
  • Show dependencies between packages
  • Something in a package uses something in another
    package
  • Typically a class in one package calls methods in
    another class.

5
Packages
A dependency
ServerServer
A Fully-Qualified Name
A package
6
Simple Package Diagram
Well-structured is acyclic
7
A Package Diagram
8
Lab 5 Package Diagram
9
Class Diagrams
  • A class diagram shows
  • Packages (sub-packages of our package diagram)
  • Classes
  • Attributes
  • Methods
  • Interfaces
  • Collaborations
  • Dependency, Generalization, Relationships
  • A class diagram is a STATIC view of system

10
Three Levels of Class Diagrams
  • Conceptual (Domain) Model
  • Analysis (Specification)
  • Implementation

11
Basic Class Diagrams
12
Basic Class Diagrams
public protected - private package /
derived
Abstract abstract
constructor query update
Class Scope (static)
Formats for boxes Visibility Attribute_Name
MultiplicityType Initial_Value
property-string Visibility Method_Name
(Parameter_List) Return-List property-string K
ind param_Name type default value
where kind in, out , inout
13
Basic Class Diagrams
Superclass
Class with parts
Note
Assembly Class
Subclass
Composition (Aggregation) (part-of, has-a)
Association (relationship)
Inheritance (Generalization) (is-a, kind-of)
14
Basic Class Diagram (Example)
takes
15
Basic Class Diagram (Example)
Person
name String - ssn String birthday
Date / age int
getName String query -calculateAge int
16
Class Diagrams (Advanced)
Cardinality (Multiplicity) 1 0..1 0.. 1..
64 2..5 2,4,10
takes
0..
17
Class Diagrams (Advanced)
Important Stereotypes ltltinterfacegtgt specify
collection of operations to specify
services ltlttypegtgt specify structure and
behavior (not implementation) ltltenumerationgtgt
specify discrete values ltltimplementationClassgtgt
helper class created in detail design
ltltenumerationgtgt Status
Idle Working Error
Fundamental Attributes
readImage writeImage
Fundamental behavior
18
Class Diagrams (Advanced)
Aggregation (independent object lifetime)
Composite (unique member, dependent)
Can have self-associations
Exception handling
ltltsendsgtgt
manager
manages
employee
directionality
19
Class Diagrams (Advanced)
20
From Domain to Analysis (Specification)
21
From Analysis (Specification) to Implementation
Book
Author
-isbnstring -titlestring
written by
-namestring

1..5
Book
Author
-isbnstring -titlestring writtenby5 Author
-namestring
- writtenby ListltBookgt
22
From Implementation to Code
Author
public class Author private String name
private List writtenby public class Book
private String isbn private String title
Author writtenby5
-namestring
- writtenby ListltBookgt
Book
-isbnstring -titlestring writtenby5 Author
23
One Additional Class Box
Class with independent Runtime thread of execution
24
Class Diagram Hints
  • Provide abstraction of problem domain
  • Embodies small set of well-defined
    responsibilities
  • Clear separation between specification and
    implementation
  • Understandable and simple
  • Show only important properties

25
Class Diagram Hints
  • Organize similar classes into packages
  • Beware of cyclical generalization/dependencies
  • Use associations where there are structural
    relationships
  • Associations are NOT comm pipes!!!!!!!
  • Start with Conceptual model, then refine details
    thru specification and implementation

26
Design Digression
  • Inheritance vs. Composition
  • Information Hiding
  • Delegation Design Pattern
  • Inheritance vs. Attribute
  • Attribute vs. Class
  • Association Checklist (page 155)
  • Class Identification (page 139)
  • Domain analysis
  • Nouns in requirements
  • Data-driven vs. Responsibility-driven
  • Proxy Classes

27
Lab 5 Class Diagram
Write a Comment
User Comments (0)
About PowerShow.com