{"componentChunkName":"component---src-templates-post-template-jsx","path":"/history/posts/2020-11-10--002","result":{"data":{"site":{"siteMetadata":{"title":"Blog by Eunyoung","subtitle":"작업 기록 블로그","copyright":"© All rights reserved.","author":{"name":"EunYoung","twitter":"#"},"disqusShortname":"","url":"https://ssongey.github.io"}},"markdownRemark":{"id":"a522dda6-c906-5d05-b13a-873f405c618d","html":"<h2>DTO</h2>\n<ul>\n<li>Data Transfer Object</li>\n<li>각 레이어 사이에 데이터를 전달하기 위한 목적으로 사용하는 Object</li>\n<li>\n<p>View Layer와 DB Layer의 역할 분리를 하기위함으로 사용</p>\n<ul>\n<li>API의 req와 res에 맞게 domain이 수정될 필요 없다.</li>\n<li>req, res에 불필요한 properties 가 들어가지 않는다.</li>\n</ul>\n</li>\n<li>필수 값에 대한 조건 체크하는 것이나 DTO 에서 Domain 으로 변환하거나, Domain 에서 DTO 로 변환하는 로직은 Domain 이 아닌 DTO 에 담겨야 한다.</li>\n<li>@NotNull 과 같은 Data 의 Validation 도 DTO 의 역할 이기 때문에 DTO 에 넣어주게 되면 역할과 책임이 좀 더 명백해지게 된다.</li>\n</ul>","fields":{"tagSlugs":["/tags/dto/"],"slug":"/history/posts/2020-11-10--002"},"frontmatter":{"title":"DTO 클래스?","tags":["dto"],"date":"2020-11-10","description":""}}},"pageContext":{"slug":"/history/posts/2020-11-10--002"}},"staticQueryHashes":[]}