This class diagram contains two classes: movie and genre. It shows how a movie (zero or many) contains a genre (one or many). We connect these classes with an association relationship.

Movie enumeration example

Movie enumeration diagram code in Gleek

Movie
+string name
+string description
+string keywords
+int releaseYear

Genre:enumeration
Action
Comedy
Drama
Fantasy
Horror
Mystery
Romance
Thriller
Western

Movie{0..*}–>{1..*}Genre

About class diagrams

Class diagrams are used in software engineering to describe the structure of a system. A class diagram uses Unified Modeling Language (UML) to show the classes, attributes, methods (or operations), and their relationships to each other in the system. Class diagrams prove valuable in object-oriented modeling. Class diagrams can be used to model the data structure or to design a system in detail.

Similar class diagram examples

Library management system class diagram

Order processing system class diagram

ATM system class diagram

Animal inheritance class diagram