请输入图片描述

在之前的文章中简单的说了一下POVOBO,图片中还有DODTO等等。

于是搜索了一下,找到了这篇文章:What is the difference between domain objects, POCOs and entities?

就把标题中的问题复制到了 ChatOpen:

What is the difference between domain objects, POCOs and entities?

I was under the impression they are all basically the same. Are model objects also the same?

Domain objects, POCOs (Plain Old CLR Objects), entities, and model objects are related concepts in software development, but they have different meanings and purposes.

Domain objects are objects that represent concepts in the problem domain of the application. They are often designed to closely reflect the domain concepts and the domain logic of the application. Domain objects typically have rich behavior and encapsulate business logic. They are often used in Domain-Driven Design (DDD) and other domain-centric architectures.

POCOs are simple classes that do not have any external dependencies on a specific framework or library. They are used to transfer data between layers of an application or between different applications. POCOs are designed to be lightweight and easy to serialize, deserialize and work with, and they are often used in object-relational mapping (ORM) frameworks, web services, and other communication protocols.

Entities are objects that represent persistent data and have a unique identity. They are typically used in data access layers and are often associated with a database table or view. Entities usually have properties that map to columns in a database table, and they may also have relationships with other entities.

Model objects are objects that represent the data and behavior of a specific view or screen in a user interface. They are often used in Model-View-Controller (MVC) or similar UI patterns to separate the concerns of the UI from the rest of the application.

In summary, while there is some overlap between domain objects, POCOs, entities, and model objects, they have different purposes and are used in different parts of an application. Domain objects are designed to represent the concepts and logic of the problem domain, POCOs are designed for data transfer and serialization, entities are used for persistence, and model objects are used to represent the data and behavior of a specific view or screen in a user interface.


Domain Objects 也就是 DO,领域对象。听起来不知所云。因为不知道Domain 是什么。

What is the domain mean in the context?

In software development, the "domain" refers to the problem domain that the software system is being developed to address. The domain represents the area of knowledge or expertise that the software is intended to support or automate.

For example, a software system developed for a hospital may have a domain that includes medical concepts, patient records, and billing processes. A software system developed for an e-commerce company may have a domain that includes products, orders, and customer data.

The domain is important because it helps to define the boundaries and scope of the software system. Understanding the domain is necessary to ensure that the software is designed and implemented to meet the needs of the users and the business. It also helps to ensure that the software is maintainable, extensible, and adaptable as the needs of the domain evolve over time.

In Domain-Driven Design (DDD), the domain is the primary focus of the software design process. The goal of DDD is to develop software systems that closely reflect the domain and the business processes that it represents. This approach helps to ensure that the software is more effective, easier to maintain, and better aligned with the needs of the business.


the "domain" refers to the problem domain. 这里的domain代表开发中的problem domain。那么什么又是problem domain?

接着搜索,找到了一篇文章:Problem Domain vs. Solution Domain

Problem Domain 就是問題發生的地方,也就是軟體開發所謂的『需求』。而 Solution Domain 就是問題的解決方案,也就是軟體開發所謂的『設計』或是『實做』。舉凡像是演算法,design patterns,refactoring,architecture 等等,都算是 Solution Domain 的範圍。

还有一篇文章:What is a domain?

简而言之,domain 表示你为了某种需求而开发软件时,这种需求所在的那个背景,比如你在开发一款电商软件,那么电子商务就是那个背景。这个概念表示的东西很模糊,不是很具体。

这样想想,Domain Objects好像和业务逻辑很相似,而且在图中,两者都在一起出现。

What difference between Domain objects and Business Objects?
They look very similar.

Domain objects and business objects are related concepts in software development, and there is often some overlap between the two.

Domain objects represent the concepts and logic of the problem domain that the software is designed to address. They are often designed to closely reflect the domain concepts and the domain logic of the application. Domain objects typically have rich behavior and encapsulate business logic.

Business objects, on the other hand, are objects that represent the data and behavior of a specific business process or use case. They are often used to model the workflows and operations of a specific business domain or department. Business objects are designed to encapsulate the business rules and logic for a particular process or use case.

The main difference between domain objects and business objects is that domain objects are designed to represent the concepts and logic of the entire problem domain, while business objects are focused on specific processes or use cases within that domain. Domain objects are often used in Domain-Driven Design (DDD) and other domain-centric architectures, while business objects are more closely associated with business process modeling and business process management (BPM).

In practice, the distinction between domain objects and business objects can be blurry, and the terms are sometimes used interchangeably. However, it is helpful to recognize the difference between the two concepts, as it can inform the design and organization of software systems and help to ensure that the software is aligned with the needs of the business.


感觉DOBO确实有一点相似,有一些重叠。

标签: none

评论已关闭