HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🍗
[New] 조규현팀
/
🐾
DailyLog
/
Entity에 Dto가 간섭해도 될까?

Entity에 Dto가 간섭해도 될까?

태그
OOP
날짜
Apr 18, 2022 09:00 AM
해결 상태
완료
Thrower
  1. Model 클래스 안에서 Dto를 매개변수로 하는 메서드? → 생소함 😳
// FixedAmountVoucher 클래스의 메서드 public static Voucher createVoucher(CreateVoucherDto createVoucherDto) { return new FixedAmountVoucher(createVoucherDto.getId(), createVoucherDto.getValue(), createVoucherDto.getCreatedAt()); }
 

🤔 Model 클래스에 Dto가 침범해도 되는지?