Class diagrams
Class diagrams are used to model classes with their fields and methods as well as their relationships with other elements. Class diagrams can also include interfaces and elements such as packages, which are used to group elements together.
Here's a really short and non-exhaustive summary of what you can define using class diagrams.
For classes, it is possible to define field and method visibility, which is interesting in terms of clearly describing what private, protected, or public is (that is, related to the encapsulation and abstraction concepts that we discussed previously). Public elements are prefixed with +, protected ones with #, and private ones with -.
Here's an example of how this looks:
As you can see from the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access