What is Java domain model?

前端 未结 6 1452
-上瘾入骨i
-上瘾入骨i 2020-12-02 22:41

I am studying a Spring book and they mention Java domain model.
What is that?

6条回答
  •  被撕碎了的回忆
    2020-12-02 23:15

    Michael Borgwardt's answer "A domain model (the term is not at all Java specific) is a class" is wrong. I am very surprised so many agree with that answer.

    A domain model is all the classes that model the behavior of the solution. It is the minimum necessary to accomplish the required behavior. The domain model is free of UI and persistence functionality (unless the problem revolves around UI or persistence).

    I have seen domain model implemented in one class but that is not the design of an object-oriented solution. In an object-oriented domain model, each concept has its own class that implements the behavior required of that concept and contains the necessary fields to maintain the state of the class.

提交回复
热议问题