Diagram Desk

MVC structure class diagram

Model, view and controller of a web app. The controller depends on model and view; the view only reads the model.

The diagram

PostController+list() void+create(request) voidPostModel+findAll() List+save(post) voidPostView+render(list) Stringcallscallsreads
Class diagram · 8 shapes

Reading it step by step

  • 'PostController' (class): 0 attributes, 2 methods.
  • 'PostModel' (class): 0 attributes, 2 methods.
  • 'PostView' (class): 0 attributes, 1 methods.
  • 'PostController' depends on 'PostModel' (calls).
  • 'PostController' depends on 'PostView' (calls).
  • 'PostView' is associated with 'PostModel' (reads).

Shape by shape

ShapeSymbolConnections
PostControllerClassholds +list() void, +create(request) void · → PostModel(calls), PostView(calls)
PostModelClassholds +findAll() List, +save(post) void · ← PostController, PostView
PostViewClassholds +render(list) String · → PostModel(reads) · ← PostController

Symbols used here

SymbolMeaning
ClassA box with name, attributes and methods.
AssociationOne class knows and uses another; solid arrow.
DependencyUses another briefly (a parameter); dashed arrow.

All class diagram symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# MVC structure class diagram
classDiagram
  class PostController {
    +list() void
    +create(request) void
  }
  class PostModel {
    +findAll() List
    +save(post) void
  }
  class PostView {
    +render(list) String
  }
  PostController ..> PostModel : calls
  PostController ..> PostView : calls
  PostView --> PostModel : reads

More class diagram examples

All SeewolLabs tools