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
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
| Shape | Symbol | Connections |
|---|---|---|
| PostController | Class | holds +list() void, +create(request) void · → PostModel(calls), PostView(calls) |
| PostModel | Class | holds +findAll() List, +save(post) void · ← PostController, PostView |
| PostView | Class | holds +render(list) String · → PostModel(reads) · ← PostController |
Symbols used here
| Symbol | Meaning |
|---|---|
| Class | A box with name, attributes and methods. |
| Association | One class knows and uses another; solid arrow. |
| Dependency | Uses another briefly (a parameter); dashed arrow. |
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