From the course: Programming Foundations: Object-Oriented Design
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Creating class diagrams: Behaviors - Python Tutorial
From the course: Programming Foundations: Object-Oriented Design
Creating class diagrams: Behaviors
- When it comes to adding behaviors to our class diagram, we should have a good idea of what to write here from creating our conceptional object model and CRC cards. I'll use the same camel case format as the attribute names. But since these represent operations, they're usually named as short verb phrases; getShieldStrength, reduceShield, and simply move. It's common practice to name methods that modify and retrieve attributes as get instant operations rather than things like change or retrieve. And some languages will even automatically generate getter and setter methods for you. Since these will eventually turn into code, we'll add parenthesis containing any parameters. For example, the reduceShield method takes an integer as it's input parameter. On the other side, I could also add a return type by putting a colon after the parenthesis followed by the return type I'm expecting back from the operation. - Now these classes may have a lot of functionality internally, but the focus…
Contents
-
-
-
-
-
-
-
Creating class diagrams: Attributes2m 24s
-
Creating class diagrams: Behaviors3m 9s
-
Converting class diagrams into code4m 29s
-
Instantiating classes3m 39s
-
Class with multiple constructors2m 29s
-
Static attributes and methods4m 19s
-
Challenge: Jukebox class diagrams1m 21s
-
Solution: Jukebox class diagrams5m 8s
-
-
-
-