Discrimination of Entity objects (POCO, entity, Model, DTO, BO, do, PO)

Source: Internet
Author: User

POCO (Plain old CLR Object) originates from the Pojo concept in the field of Java EE programming (presented in 2000 by Martin Fowler) and the pots (Plain old telephone Service) concept. Poco is applied to the. NET Framework-oriented CLR (Common Language Runtime, Common language runtime). But Poco itself does not depend on the external framework, it is plain.

The advantages of Poco:

    • Simple data storage mechanism simplifies inter-layer data transfer and serialization.
    • can be used in dependency injection and warehouse (Repository) mode.
    • Reduces dependency and complexity on other logical layers, enabling loose coupling (higher logic layers need to consider poco,poco not caring about anything else).
    • Testability is achieved by simplifying the implementation.

Poco is a qualified noun in the domain of computers.

An entity is a body that represents itself, actual or latent, concrete or abstract, physical, or non-physical. Entity is a non-computer domain-qualified noun, so there are sometimes data entity or poco entity.

Model is a mathematical logical noun, which includes a set of finite operations and a relationship defined on it, mainly used for analysis and design process.

A DTO (Data Transfer object) is a data transfer entity that is used to pass data between processes. Its concept from interprocess communication to local and remote interfaces such as Web services, each call is a very resource-intensive and performance operation.

The difference between a dto and a Bo or DAO is that a DTO has no behavior (methods), just a query (accessor and modifier) that stores and provides the data it owns. A DTO is a simple object that does not contain any business logic that needs to be tested.

DTO patterns are often mistakenly used in scenarios other than remote interface invocation, which is actually wrong, which means that the objects used by intra-process inter-layer calls should not be called DTOs.

All entities in an app (entity) are business objects, but not all business objects are entities. Business objects include entity objects that contain methods, and value objects that do not contain methods (values object).

Business entities encapsulate the business logic or business rules required for higher-order logic. It uses entity fields to adjudicate or, if necessary, to modify and serialize entities.

Domain object/entity/type (domain Object/entity/class) contains complex business logic. The different behavioral logic and business rules under multiple conditions are described. There is no general distinction between domain entities and operational entities, and most of the cases of domain entities are due to their complex logic and rules.

Persistent objects/entities/types (persistent object/entity/class) are primarily intended to save data to a carrier type in memory or in a database.

Discrimination of Entity objects (POCO, entity, Model, DTO, BO, do, PO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.