I always encounter these 2 words.
我总是遇到这两个字。
I know that when you are talking about domain model you are talking about objects.
我知道当你谈论领域模型时,你谈论的是对象。
And persistence layer is a layer you store your data, eg. MySQL database.
持久层是存储数据的层,例如。 MySQL数据库。
But could someone explain these words more thoroughly?
但有人可以更彻底地解释这些话吗?
Why is it called domain? Why persistence?
为什么称它为域名?为什么坚持?
Thanks!
谢谢!
1 个解决方案
#1
12
It's called domain, because the definition applies.
它被称为域,因为该定义适用。
For details on the Domain Model, read the wikipedia and PoEAA definitions.
有关域模型的详细信息,请阅读*和PoEAA定义。
For example, if you were building software to handle air traffic control, air traffic control is your domain. How you model this using your objects is your domain model.
例如,如果您正在构建软件来处理空中交通管制,那么空中交通管制就是您的领域。如何使用对象对此进行建模是您的域模型。
As far as persistence, again the definition explains it all. The persistence layer is where you store your data, but you already know this. This term is used because it's agnostic. Not all data is persisted in the same manner -- some use databases, some use XML, some use a remote service.
就持久性而言,定义再次解释了这一切。持久层是存储数据的地方,但您已经知道了这一点。使用该术语是因为它是不可知的。并非所有数据都以相同的方式持久存在 - 一些使用数据库,一些使用XML,一些使用远程服务。
#1
12
It's called domain, because the definition applies.
它被称为域,因为该定义适用。
For details on the Domain Model, read the wikipedia and PoEAA definitions.
有关域模型的详细信息,请阅读*和PoEAA定义。
For example, if you were building software to handle air traffic control, air traffic control is your domain. How you model this using your objects is your domain model.
例如,如果您正在构建软件来处理空中交通管制,那么空中交通管制就是您的领域。如何使用对象对此进行建模是您的域模型。
As far as persistence, again the definition explains it all. The persistence layer is where you store your data, but you already know this. This term is used because it's agnostic. Not all data is persisted in the same manner -- some use databases, some use XML, some use a remote service.
就持久性而言,定义再次解释了这一切。持久层是存储数据的地方,但您已经知道了这一点。使用该术语是因为它是不可知的。并非所有数据都以相同的方式持久存在 - 一些使用数据库,一些使用XML,一些使用远程服务。