Spring Boot 2.0 Projects
上QQ阅读APP看书,第一时间看更新

Class diagram for the domain model

The domain model is the most important part of an application; some applications have run for years on end with multiple frontend technologies but without ever changing the existing domain model. A well-built domain model can easily support multiple business logic and can run an application on limited resources efficiently.

The following is the simple class diagram for this web application:

There are two main domain models and one enumeration, as shown in the preceding diagram. Those are as follows:

  • Comment: This is the main domain model, which will store the actual comment, comment type, comment created date, comment create a user, and so on
  • User: This is the domain model, which will store the username, password, and role of a registered user
  • CommentType: This enumeration is to differentiate comments by type