Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] TicketEntryTime의 검증 로직을 Ticket의 addTicketEntryTime 메소드로 이동한다. #155

Closed
seokjin8678 opened this issue Jul 29, 2023 · 4 comments · Fixed by #161
Assignees
Labels
BE 백엔드에 관련된 작업 ⚙️ 리팩터링 리팩터링에 관련된 작업 🙋‍♀️ 제안 제안에 관한 작업

Comments

@seokjin8678
Copy link
Collaborator

seokjin8678 commented Jul 29, 2023

✨ 세부 내용

TicketEntryTime의 검증 로직을 Ticket의 addTicketEntryTime 메소드로 이동합니다.

이유는 다음과 같습니다.

  1. TicketEntryTime은 엔티티지만, 필드에는 참조하는 다른 엔티티가 없는 값 객체에 가까움.
  2. 해당 객체가 Stage의 의존성과 Stage의 시작 시간에 관한 정보를 알 필요는 없음
  3. TicketEntryTime 엔티티의 영속은 Ticket의 addTicketEntryTime 메서드에서 영속
  4. 따라서 생성 시 로직을 addTicketEntryTime 메서드에서 하는게 좋아보임

⏰ 예상 소요 시간

30분

@seokjin8678 seokjin8678 added BE 백엔드에 관련된 작업 ⚙️ 리팩터링 리팩터링에 관련된 작업 🙋‍♀️ 제안 제안에 관한 작업 labels Jul 29, 2023
@seokjin8678 seokjin8678 added this to the 3차 데모데이 milestone Jul 29, 2023
@seokjin8678 seokjin8678 self-assigned this Jul 29, 2023
@seokjin8678
Copy link
Collaborator Author

리팩터링한 커밋은 다음과 같습니다.
8d9eb4a

@carsago
Copy link
Collaborator

carsago commented Jul 30, 2023

저도 이런 방식으로 푸는게 더 좋아보입니다.
TicketEntryTime의 제약조건이 TicketEntriyTime.of()라는 정적팩토리 메소드에만 의존해서 검증되는 것도 부담스럽고요.

@xxeol2
Copy link
Member

xxeol2 commented Jul 31, 2023

값객체라 샹각하니까 이 방식이 더 자연스러워보이네요!

@BGuga
Copy link
Member

BGuga commented Jul 31, 2023

2번 이유가 상당히 납득이 되네요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드에 관련된 작업 ⚙️ 리팩터링 리팩터링에 관련된 작업 🙋‍♀️ 제안 제안에 관한 작업
Projects
Status: Done
4 participants