Presentation is loading. Please wait.

Presentation is loading. Please wait.

UML DIAGRAMS Unified Modeling Language for Object Oriented Programming Unified Modeling Language for Object Oriented Programming.

Similar presentations


Presentation on theme: "UML DIAGRAMS Unified Modeling Language for Object Oriented Programming Unified Modeling Language for Object Oriented Programming."— Presentation transcript:

1 UML DIAGRAMS Unified Modeling Language for Object Oriented Programming Unified Modeling Language for Object Oriented Programming

2 UML Diagrams UML stands for Unified Modeling Language The goal is for UML to become a common language for creating models of object oriented computer software. Our diagrams aim to represent the objects in our programs and how they relate to each other! UML stands for Unified Modeling Language The goal is for UML to become a common language for creating models of object oriented computer software. Our diagrams aim to represent the objects in our programs and how they relate to each other!

3 UML Diagrams Modeling a Class Class Icon Modeling a Class Class Icon Enemy health : float pos : PVector void update() boolean escaped() CLASS ATTRIBUTES FUNCTIONS/METHODS

4 UML Diagrams Modeling a Class Class Icon Modeling a Class Class Icon Wave enemyList : ArrayList waveNum : int void createWave() void update() CLASS ATTRIBUTES FUNCTIONS/METHODS

5 Composition Relationships Each instance of type Wave contains an list of type Enemy. This is a relationship known as composition WaveEnemy - Wave contains Enemies - The ‘life’ of an Enemy depends on the ‘life’ of the Wave - Wave is the “owner” of Enemy - Enemies are created only when a Wave is created and destroyed when Waves are destroyed 0..1 1.. *

6 Aggregation Relationship Aggregation is shown with an open diamond. The aggregate class (the class with the unfilled diamond touching it) is in some way part of the “whole” The other class in the relationship is “part” of that whole but doesn’t require the “whole” to exist. (‘*’ shows the Pond can have many Ducks) The Duck survives if the Pond is removed Aggregation is shown with an open diamond. The aggregate class (the class with the unfilled diamond touching it) is in some way part of the “whole” The other class in the relationship is “part” of that whole but doesn’t require the “whole” to exist. (‘*’ shows the Pond can have many Ducks) The Duck survives if the Pond is removed PondDuck 0..1 0.. *

7 Association Relationship Objects are associated when neither is a “part” of the other AND each object can “exist” separately StudentCourse 0..*0..* 0..* - shows ‘multiplicity’, the possible number instances of that object

8 Inheritance RocketLauncher Laser Tower

9 What type of relationship? Car - Engine Car - Floor Mats Car - Gas Tank Car - Driver Car - Engine Car - Floor Mats Car - Gas Tank Car - Driver Composition Composition Aggregation Association


Download ppt "UML DIAGRAMS Unified Modeling Language for Object Oriented Programming Unified Modeling Language for Object Oriented Programming."

Similar presentations


Ads by Google