A little bit of UML Csaba Veres. UML A de facto standard for OO analysis and design Many components...

Preview:

Citation preview

A little bit of UML

Csaba Veres

UML

A de facto standard for OO analysis and design

Many components class diagrams use cases interaction diagrams ...

Perspectives Conceptual model (analysis)

language independent often no direct mapping from concepts to

classes Specification (design)

interface, not implementation types rather than classes a type can have many implementations as classes

Implementation classes, methods, etc.

Associations a conceptual relationship between classes

an Order comes from a single Customer and one Customer can make several Orders

a specification of responsibility a Customer knows about its Orders

an implementation of pointers or some sort of reference class Customer {

private Vector _orders;

Detail

Concept model: multiplicity Implementation model:

navigability

Multiplicity (cardinality)

Navigability

<<Stereotypes>> a high-level classification of the ”sort

of” object an object is controller interface

suggests certain general responsibilities can be used to extend basic UML

semantics can stereotype classes, relationships,

etc.

Multiple classification an object may be described by several

types not necessarily connected by inheritance i.e. multiple classification multiple

inheritance mi states that an object must have a single

type (with several supertypes) mc states that an object could be defined

as one of several types, depending on the purpose

Multiple classification (2)

Legal objects: (Female,Patient,Nurse) (Male,Physiotherapist) (Female,Doctor,Surgeon)

Illegal objects (Patient,Doctor) (Male,Doctor,Nurse)

Dynamic classification

Aggregation and composition

person

male

female

gender {}

Person

Male

Femalesex{complete}

Gender

type{complete}

must be male or female Gender

p e rs o n

g e n d e r

{}partition

Person Gender<<partition>>

Recommended