Upload
lani-vaughan
View
18
Download
0
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
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
Methods are listed here
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
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.
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!
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
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….
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