Domain Model pattern example

前端 未结 3 726
春和景丽
春和景丽 2021-02-01 10:20

I\'m just trying to find some examples of Martin Fowler\'s Domain Model pattern and I can\'t.

From what I found on the Internet Domain Model is just adding some \"logi

3条回答
  •  旧巷少年郎
    2021-02-01 11:21

    A "domain model" is simply an object which represents some discernible concept in your business domain. A "Customer", an "Order", etc. Whatever the business logic is, the tangible entities which make up that logic are the models in your domain.

    Some will have lots of business logic (perhaps worth breaking up into other classes), some will have very little (or even none).

    The difference between a "domain model" and any other class isn't a construct of the Java language itself, it's mainly a semantic construct of the business logic that you define.

提交回复
热议问题