From 09a9a4e94bf3f8523dcca8f1de2cb386b95a06df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E5=A3=AB=E4=BC=9F?= Date: Thu, 11 Oct 2018 14:43:30 +0800 Subject: [PATCH] Translate the best-practices/data-transfer-objects the document --- docs/zh-Hans/Best-Practices/Data-Transfer-Objects.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/zh-Hans/Best-Practices/Data-Transfer-Objects.md b/docs/zh-Hans/Best-Practices/Data-Transfer-Objects.md index 2d25ce7f41..f38dc07084 100644 --- a/docs/zh-Hans/Best-Practices/Data-Transfer-Objects.md +++ b/docs/zh-Hans/Best-Practices/Data-Transfer-Objects.md @@ -1,7 +1,7 @@ -## Data Transfer Objects Best Practices & Conventions +## 数据传输对象最佳实践&约定 -* **Do** define DTOs in the **application contracts** package. -* **Do** inherit from the pre-built **base DTO classes** where possible and necessary (like `EntityDto`, `CreationAuditedEntityDto`, `AuditedEntityDto`, `FullAuditedEntityDto` and so on). -* **Do** define DTO members with **public getter and setter**. -* **Do** use **data annotations** for **validation** on the properties of DTOs those are inputs of the service. -* **Do** not add any **logic** into DTOs except implementing `IValidatableObject` when necessary. \ No newline at end of file +* **推荐** 在 **application.contracts** 层中定义DTO. +* **推荐** 在可能和必要的情况下从预构建的 **基础DTO类** 继承 (如 `EntityDto`, `CreationAuditedEntityDto`, `AuditedEntityDto`, `FullAuditedEntityDto` 等). +* **推荐** 定义 **public getter 和 setter** 的DTO成员 . +* **推荐** 使用 **data annotations** **验证** service输入DTO的属性. +* **不推荐** 在DTO中添加任何 **逻辑**, 在必要的时候可以实现 `IValidatableObject` 接口. \ No newline at end of file