외부 교육/빅데이터 엔지니어 교육

DTO 상세 정리

민둥곰 2021. 12. 1. 19:19

Method Call 을 줄이기 위한 목적

즉. 단일 호출로 여러개의 매개변수를 처리하는데 목적이 있으며 서버로의 작업 왕복을 줄여준다.

서버 호출이 단일로 이뤄진다는 것은 결국 네트워크 오버헤드를 줄여주는 효과를 불러온다.

 

Process <-> Process 데이터 전달의 목적이 있다.

 

DTO의 경우 일반적(normally)으로 POJO(Plain Old Java Object)로 생성된다.

 * POJO 로 생성된다는 것은 Data 의 캡슐화(Encapsulation)가 가능하다는 특징

 

그 어떤 비즈니스 로직(Business logic)을 포함하지 않으며 평면(flat) 데이터 구조를 띄게된다.

 

Data의 저장(Storage), 접근(Access)만 하는 점이 특징

 

 

 

Layered Architecture에서 DTO는 레이어(Layer)간의 Data 전달 목적으로 사용

 

 

결론
1. Method Call을 줄이기 위한 목적

2. Domain -> Presentation Layers 로 Data가 이동 될때 Data 캡슐화의 목적

Domain Model 을 캡슐화 하는 목적으로 쓰이게 된다.

 

 

ReF: 

https://www.baeldung.com/java-dto-pattern

https://tecoble.techcourse.co.kr/post/2021-04-25-dto-layer-scope/

https://slipp.net/questions/93

https://buildplease.com/pages/repositories-dto/

https://www.martinfowler.com/eaaCatalog/dataTransferObject.html

https://martinfowler.com/bliki/LocalDTO.html

https://docs.microsoft.com/ko-kr/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-5

 

아래 내용은 추후 확인 해야할 내용

 

DTO: Presentation Layers, 퍼사드 패턴(Facade Pattern)  data mapping 

DTO는 (CQRS)Command and Query Responsiblity Segregation) ,Data Mappers, (CQS)CommandQuerySeparation등의 복잡한 결과를 불러 올 수 있다.

 

Facade pattern : https://lktprogrammer.tistory.com/42

Layered Architecture: https://happy-coding-day.tistory.com/189,

https://velog.io/@hojin11choi/TIL-%EA%B3%84%EC%B8%B5%ED%98%95-%EC%95%84%ED%82%A4%ED%85%8D%EC%B3%90-Layered-Architecture

 

CQRS: https://justhackem.wordpress.com/2016/09/17/what-is-cqrs/

Event Sourcing: https://justhackem.wordpress.com/2017/02/05/introducing-event-sourcing/

Domain model https://martinfowler.com/eaaCatalog/domainModel.html

'외부 교육 > 빅데이터 엔지니어 교육' 카테고리의 다른 글

DAO DTO Vo 정리 - 1  (0) 2021.12.01