UML Class Diagrams Today we follow on from

  • Slides: 18
Download presentation
UML Class Diagrams

UML Class Diagrams

Today we follow on from Structured Programming last time with a tutorial on creating

Today we follow on from Structured Programming last time with a tutorial on creating UML Class Diagrams

UML Diagrams • • Class Object Package Composite Structure Component Deployment Profile • •

UML Diagrams • • Class Object Package Composite Structure Component Deployment Profile • • Use Case Activity State Machine Sequence Communication Timing Interaction Overview Prod Tech only use Class Diagrams

Diagrams should Tell a Story Professional programming says All classes must be included on

Diagrams should Tell a Story Professional programming says All classes must be included on at least one class diagram. • Select classes for a diagram which will tell a story • Class names and links technically accurate • Extra information to tell the story, but no more

Tool = White Star UML

Tool = White Star UML

Class • • Name Attributes = Properties Operations = Methods Stereo. Type can be

Class • • Name Attributes = Properties Operations = Methods Stereo. Type can be used for generic ancestor e. g. form, data record

Generalisation = Inheritance TMy. Sub. Class = class(TMy. Class); Note which way the arrow

Generalisation = Inheritance TMy. Sub. Class = class(TMy. Class); Note which way the arrow is

Example Inheritance

Example Inheritance

Composition = Ownership TMy. Class = class FOwned: TOwned; constructor: Create FOwned =TOwned. Create;

Composition = Ownership TMy. Class = class FOwned: TOwned; constructor: Create FOwned =TOwned. Create; destructor: Free. And. Nul(FOwned); property Owned read FOwned; end;

Aggregation = Reference TMy. Class = class FReferenced: TReferenced; property Referenced read FReferenced write

Aggregation = Reference TMy. Class = class FReferenced: TReferenced; property Referenced read FReferenced write FReferenced; end;

Examples

Examples

Dependency TMy. Class is dependent on TSingleton, but none of Generalization, Composition or Aggregation

Dependency TMy. Class is dependent on TSingleton, but none of Generalization, Composition or Aggregation apply

Association It is useful to the story to show a relationship between two classes,

Association It is useful to the story to show a relationship between two classes, but no other link is appropriate. Write a comment to explain

Comments are good, and should be brief

Comments are good, and should be brief

Multiplicity Optional numbers at the end(s) of the links show many instances can exist

Multiplicity Optional numbers at the end(s) of the links show many instances can exist

Examples

Examples

Homework Yaroslav Update class diagram for the System VI Customize Page Oleg ? Alexey

Homework Yaroslav Update class diagram for the System VI Customize Page Oleg ? Alexey Update DBvi Prod_Other class diagram