Data Transfer Object
数据传输对象(data transfer object,DTO) 是面向对象编程的一个概念,是指跨进程通信(通常是网络)之间数据传输的对象。这些对象通常只能序列化、存储、分发和反序列化,不包含任何业务逻辑。
举例,用户注册接口需要传入的参数有 username
和 password
,对于 API 服务而言,该接口的 DTO 就包含这两个属性。
Data Transfer Object DTO Definition and Usage
A data transfer object (DTO) is an object that carries data between processes. You can use this technique to facilitate communication between two systems (like an API and your server) without potentially exposing sensitive information.[1]
okta