UML Class Diagram Editor

Draw a UML class diagram by dragging boxes and typing members, link them with inheritance, realization, composition, aggregation, association or dependency arrows, then export a picture or PlantUML and Mermaid code.

Działa w Twojej przeglądarce. Twoje pliki nigdy nie opuszczają urządzenia. Zobacz, jak to sprawdzić

…

Jak to zrobić

  1. 1
    Add boxes

    Press Class, Abstract class, Interface or Enum, or start from the online shop sample.

  2. 2
    Edit members

    Select a box and type attributes and methods one per line with visibility marks.

  3. 3
    Connect

    Choose From, To and the relation type, then set multiplicities and a label.

  4. 4
    Arrange

    Drag boxes or press Auto layout to place parents and wholes above their children.

  5. 5
    Check

    Open the Checks tab for duplicate names, misplaced members and inheritance cycles.

  6. 6
    Export

    Download SVG or PNG, copy PlantUML or Mermaid code, or print the diagram.

O tym narzędziu

A class diagram shows the static structure of a system: the types it contains, what data and operations each type has, and how the types relate. This editor gives you a canvas where every box is a class, an abstract class, an interface or an enumeration. Each box has a name compartment with the stereotype written in guillemets, an attribute compartment and an operation compartment, drawn exactly as the UML specification lays them out. Members are typed one per line with the visibility marks the standard uses: a plus for public, a minus for private, a hash for protected and a tilde for package. Add {static} to underline a member and {abstract} to set it in italics. Boxes move by dragging with a mouse or a finger, and the arrow keys nudge the selected one. Relations come in the six kinds that matter in practice. Inheritance and realization end in a hollow triangle, realization and dependency are dashed, composition carries a filled diamond at the whole and aggregation a hollow one, and association ends in an open arrow. Every relation can carry a multiplicity at each end and a label in the middle. An auto layout places parents and wholes above their children and parts and orders each row to reduce crossings. A check panel reports duplicate names, members that look misplaced, relations to deleted boxes, inheritance cycles and classes that extend an interface instead of implementing it.

From diagram to code and back

Exports cover the common destinations. SVG keeps the diagram sharp in documents and wikis, PNG at double resolution suits slides and chat, and the print button gives a page you can save as PDF. The PlantUML export writes class blocks and arrows in the order PlantUML expects, with the parent on the left of an inheritance arrow and multiplicities in quotes, so the file renders the same on a PlantUML server or in an IDE plugin. The Mermaid export targets the classDiagram syntax used by GitHub and many documentation sites. Going the other way, paste a PlantUML class diagram and the importer reads class, abstract class, interface and enum blocks, members, the six arrow types with multiplicities and labels, then lays the boxes out for you. Lines it does not understand are listed rather than silently dropped.

Worked example

The sample is a small online shop with 9 boxes and 8 relations. Customer places Order with multiplicity 1 to 0..*. Order owns OrderLine by composition, 1 to 1..*, so deleting an order deletes its lines. Each OrderLine refers to exactly one Product, an abstract class with an abstract shippingWeight() method. PhysicalProduct and DigitalProduct inherit from it, CardPayment realizes the PaymentMethod interface, Order depends on PaymentMethod and refers to the OrderStatus enumeration with the values NEW, PAID, SHIPPED and CANCELLED. The PlantUML export contains the line Order "1" *-- "1..*" OrderLine and the line Product <|-- PhysicalProduct, and importing that text back gives the same 9 boxes and 8 relations with the same multiplicities. The checks panel reports no problems for this model.

Limits

This is a drawing and modelling aid, not a code generator, and it does not keep a diagram in sync with source code. Arrows are straight lines between box edges, so very dense diagrams may need boxes moved by hand to avoid overlaps. Packages, notes, association classes and generics are not drawn.

Przykład z rozwiązaniem

Online shop model: 9 boxes, 8 relations, exported as Order "1" *-- "1..*" OrderLine in PlantUML.

W skrócie

Najczęstsze pytania

What is the difference between composition and aggregation?

Both mean that one class contains others. With composition the parts live and die with the whole, such as order lines inside an order, and the diamond is filled. With aggregation the parts can exist on their own, such as players in a team, and the diamond is hollow.

When should I use realization instead of inheritance?

Use realization, the dashed line with a hollow triangle, when a class implements an interface. Use inheritance, the solid line with a hollow triangle, when a class extends another class. The checks panel warns when a class extends an interface.

How do I write multiplicity?

Type it in the From and To fields of a relation: 1 for exactly one, 0..1 for optional, * or 0..* for any number and 1..* for at least one. Each value is drawn next to the box at that end.

Can I import an existing PlantUML file?

Yes. Paste it in the PlantUML tab and press Import. Class, interface, abstract class and enum blocks, members and the six relation arrows are read; skinparam and layout hints are ignored, and anything else is listed as skipped.

Does it work on a phone?

Yes. Boxes can be dragged with a finger, the edit panels stack under the canvas, and all buttons are large enough to tap. The canvas scrolls inside its frame, so the page itself does not scroll sideways.

Where is my diagram saved?

In this browser's local storage, with undo and redo for every change. Use Export file to keep a JSON copy or move the diagram to another computer, and Import file to load it again.

Całkowicie za darmoBez opłat i rejestracji
Pliki zostają prywatneWszystko działa w Twojej przeglądarce
Łatwo w Twoim językuDostępne w wielu językach