Class Diagram in draw.io for a Domain Model
A domain model is a simple class diagram of the things a business works with. Learn how to draw one for free in draw.io: classes with their attributes, associations named with a verb, and the numbers that say how many, using a library system.
Step by step
The things in the business
- Domain models. Before anyone builds a library system, the team must agree on the words. What is a member, a book, a loan? A domain model is a simple class diagram that shows them. Here's ours.
- Blank diagram. Start a blank diagram in draw.io.
- Class boxes. We need a box with a name on top and a list of attributes below. The entity box gives us exactly that. Click more shapes, tick entity relation, and click apply.
Classes
- Class. A class is a thing the business keeps track of. Drag in the box and name it with a singular noun. Member.
- Attributes. Double click the lower part and type the attributes, one per line. These are the facts we keep about each member.
- Class. Add a second class on the right. Book.
- Attributes. Its attributes. I SBN, title and author.
The class in the middle
- Loan. A member borrows many books over time, and a book is borrowed by many members. The borrowing itself is a thing with its own facts. That's a loan. Put it in the middle. A loan has a start date, a due date and a return date.
Associations
- Association. Now the associations. Click member, hold control, click loan, then click the plain line in general shapes. Label it with a verb and the numbers. One member makes zero or more loans. Do the same from loan to book. Each loan is for exactly one book, and a book can have zero or more loans.
- Read the numbers. Read each line from left to right. The number on each side belongs to the class on that side. Star means many.
- The finished model. Click away to see the finished domain model. Three classes, their attributes, and two named associations.
Recap
- The rules. So, name classes with singular nouns, list the facts as attributes, name every association with a verb, and say how many on each side. Subscribe for more draw.io tips for business analysts.