About uml class diagram generator
Outline your classes, members and inheritance and get a UML class diagram.
Notation
- + public, - private and # protected members.
- A triangle arrow shows inheritance; a diamond shows composition.
A worked example
A class Animal with a name and a method speak(), and classes Dog and Cat that inherit from it, produces a class diagram with three boxes and inheritance arrows. Use it to explain design to teammates or to plan code before writing it.
Reading the arrows
- A hollow triangle means inheritance.
- A line with a diamond means composition or aggregation.
- A dashed arrow shows a dependency.
A worked example
Add a class Account with balance and deposit(), then SavingsAccount inheriting from Account with interestRate. The diagram shows the inheritance arrow and lists each class's fields and methods, which is a good basis for code.
When to use UML
Class diagrams help in design discussions and documentation. For small scripts they are usually unnecessary, so keep them for systems with several interacting classes.
