-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add(.footprint) : 발자취 도메인 엔티티 분리 및 매핑 #178
Conversation
0a6653b
to
caae242
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주웅님 고생하셨습니다ㅎㅎ
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/Ajaja.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/FootprintEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/mapper/FootprintMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/mapper/FootprintMapper.java
Outdated
Show resolved
Hide resolved
src/main/resources/db/migration/V9__add_footprint_domain_schema.sql
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/application/port/out/GetFootprintPort.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/GetFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/CreateFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구두로 말씀드린 내용과 함께 개선해보면 좋을 것 같습니다!
고민하시느라 고생 많으셨어요 ㅎㅎ
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/CreateFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/CreateFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/FootprintJpaRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/GetFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/FootprintEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/FootprintEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/domain/FootprintFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/domain/FootprintFactory.java
Outdated
Show resolved
Hide resolved
770b596
to
86601d0
Compare
436ad24
to
dbdcf59
Compare
dbdcf59
to
a1d6d61
Compare
Test Coverage Report
|
65df1d6
to
9892a93
Compare
9892a93
to
c884136
Compare
Test Coverage Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
많은 고민이 느껴져서 좋았습니다!
프로젝트 중간에 들어오셔서 기술에 대한 고민을 좀 더 해보면 좋겠다? 라는 생각이 들었던 것 같아요 ㅎㅎ 저랑 많은 이야기를 해보죠!
그리고 리뷰에 대한 피드백은 부탁드립니다 ㅋㅋ resolve할 수 있게!!
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/GetFootprintAdaptor.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/TargetEntity.java
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/adapter/out/persistence/model/WriterEntity.java
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/domain/FootprintFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/dto/FootprintParam.java
Outdated
Show resolved
Hide resolved
src/main/java/me/ajaja/module/footprint/mapper/FootprintMapper.java
Outdated
Show resolved
Hide resolved
src/main/resources/db/migration/V9__add_footprint_domain_schema.sql
Outdated
Show resolved
Hide resolved
src/test/java/me/ajaja/module/footprint/adapter/out/persistence/GetFootprintAdaptorTest.java
Outdated
Show resolved
Hide resolved
src/test/java/me/ajaja/module/footprint/adapter/out/persistence/CreateFootprintAdaptorTest.java
Outdated
Show resolved
Hide resolved
Test Coverage Report
|
Test Coverage Report
|
🔍 어떤 PR인가요?
😋 To Reviewer
상속 구조에 대한 DB 테이블 생성 전략은 구분자를 사용한 단일 테이블 전략을 사용했습니다.
선택한 이유는 가장 간단했고, 발자취 유형이 한정되어 테이블의 크기가 크지 않아 조회 성능에 부정적이지 않다고 생각했기 때문입니다.
선택 시 참고한 자료
매핑 과정에서 반드시 컬럼이 필요하기 때문에 유형별로 매핑을 만들었습니다.
다만 공통부분은 재 사용할 수 있도록 처리했습니다.
엔티티에서 아자자, 태그 부분은 ElementTable을 사용해 별도의 관계테이블을 만들었습니다.
조회시 별도의 쿼리를 작성하기 보단 jpa를 통해 같이 가져 올 수 있는게 간단하다고 판단했기 때문입니다.
생성 시 유형 분리에 대한 책임을 port에 주었습니다. 적절한지 모르겠지만 현재 상황에선 최선이었습니다.
또한 분기처리 코드가 별로입니다.
혹시 가능하다면 17 preview 기능을 허용해 swtich 패턴매핑을 사용해서 개선할 수 있을 것 같습니다. 해도 될까요?
심지어 instanceOf로 타입캐스팅도 안되더라고요... 제가 잘못한건지.. 암튼 이부분좀 잘 봐주세요.
✅ 작성한 테스트
매핑 구현에 대한 테스트만 진행했습니다.
또한 제가 킹받게 픽스쳐 몽키 해당 클래스에서 빌드 해놨는데, 전체 논의 후에 따로 분리하도록 하겠습니다. 덜 킹받아주세요...