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

Creating class diagrams: Behaviors - Python Tutorial

From the course: Programming Foundations: Object-Oriented Design

Start my 1-month free trial

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