> For the complete documentation index, see [llms.txt](https://ankang.gitbook.io/commons/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ankang.gitbook.io/commons/commons-beans/ru-men/bei-jing.md).

# 背景

在分层应用的开发过程中，开发人员需要针对各层的特点封装不同的数据对象，如：VO（View Object，展示层对象）、DTO（Data Transfer Object，数据传输对象）、Entity/DO（Data Object，数据层对象）等。随之而来的就是数据对象的转换需求。

#### 在不同层次的数据对象拷贝过程中，常用的处理方式有：

* 手动拷贝：
  * 优点：代码可控性强，可以避免复杂对象拷贝的潜在问题
  * 缺点：编码复杂，后期维护难，字段容易有遗漏
* Spring/Commons的BeanUtils：
  * 优点：使用简单，轻量
  * 缺点：只能处理简单的字段，无法处理复杂的映射
* Dozer等映射框架：
  * 优点：开源，有很多项目实践检验
  * 缺点：不一定符合项目需求，对懒加载支持不好，扩展/修改困难

为了简化开发人员的工作，解决现有方案存在的问题以及更好地适应项目需要，commons-beans项目应运而生。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ankang.gitbook.io/commons/commons-beans/ru-men/bei-jing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
