Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Take a second and remind yourself why you want to make your methods intuitive: because every program solves a problem or has a purpose. It might not be a business problem—sometimes a program’s purpose (like FlashyThing) is just to be cool or fun! But no matter what your program does, the more you can make your code resemble the problem you’re trying to solve, the easier your program will be to write (and read, and repair, and maintain...).
A class diagram is a simple way to draw your classes out on paper. It’s a really valuable tool for designing your code BEFORE you start writing it.
|
ClassName |
|---|
|
Method() Method() Method() ⋮ |
Write the name of the class at the top of the diagram. Then write each method in the box at the bottom. Now you can see all of the parts of the class at a glance!