9
UML Diagrams

UML Diagrams

Embed Size (px)

DESCRIPTION

UML Diagrams. Notebooks OUT! No, you will not be taking notes… but you will need your notebook!. UML Diagrams. When designing a class it helps to draw a UML diagram. UML – Unified Modeling Language This is the standard that professionals use. Class Name goes here. Fields are listed here. - PowerPoint PPT Presentation

Citation preview

Page 1: UML Diagrams

UML Diagrams

Page 2: UML Diagrams

• Notebooks OUT!

• No, you will not be taking notes… but you will need your notebook!

Page 3: UML Diagrams

UML Diagrams

• When designing a class it helps to draw a UML diagram.– UML – Unified Modeling Language– This is the standard that professionals use.

Class Name goes here

Fields are listed here

Methods are listed here

Page 4: UML Diagrams

UML Diagrams

• Add your members to the UML:

RectangledblLength

dblWidth

setLength( )

setWidth( )

getLength()

getWidth()

getArea()

Class Name goes here

Fields are listed here

Methods are listed here

Page 5: UML Diagrams

UML Diagrams

• Indicate if the members are public or private:

Rectangle-dbLength-dblWidth

+setLength(dblPLength)

+setWidth(dblPWidth)

+getLength()

+getWidth()

+getArea()

- This means that the member is private

+ This means that the member is public

• Also, list the method’s parameters.

Page 6: UML Diagrams

UML Diagrams

• State whether the methods are void or return a value:

Rectangle-dbLength -dblWidth

+setLength(dblPLength) : void

+setWidth(dblPWidth) : void

+getLength() : double

+getWidth() : double

+getArea() : double

Class Name goes here

Fields are listed here

Methods are listed here

Congrats! You’re Done!

Page 7: UML Diagrams

UML Diagrams

• Keep in mind, that most people are not as smart as us. They are not using our variable notation.

• This is how a UML diagram looks if your variable name does not specify its data type:

Rectangle-length : double-width : double

+setLength(len : double) : void

+setWidth(w : double) : void

+getLength() : double

+getWidth() : double

+getArea() : double

Page 8: UML Diagrams

UML Diagrams

• Take the next minute and practice creating a UML.

• Create one of your Circle Class.

• Again, here is the example of the Rectangle class….

Page 9: UML Diagrams

UML Diagrams

Rectangle-dbLength -dblWidth

+setLength(dblPLength) : void

+setWidth(dblPWidth) : void

+getLength() : double

+getWidth() : double

+getArea() : double

Class Name goes here

Fields are listed here

Methods are listed here