-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor | CAKK-103 | Entity 네이밍 변경 및 애그리거트 추상 클래스 구현 #230
Conversation
Test Results201 tests 201 ✅ 44s ⏱️ Results for commit 3fd10e7. |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop #230 +/- ##
=============================================
- Coverage 92.14% 90.19% -1.95%
+ Complexity 329 238 -91
=============================================
Files 109 59 -50
Lines 967 612 -355
Branches 34 17 -17
=============================================
- Hits 891 552 -339
+ Misses 58 51 -7
+ Partials 18 9 -9
Continue to review full report in Codecov by Sentry.
|
@@ -0,0 +1,31 @@ | |||
package com.cakk.domain.base | |||
|
|||
abstract class ValueObject<T : ValueObject<T>> { |
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.
ValueObject 추상 클래스 목적은 VO 관련 사용하려고 만드신건가요?
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.
네, 다음과 같은 값객체를 만들기 위함 입니다.
data class Device(
val os: String,
val token: String
) : ValueObject<Device>(){
override fun getEqualityFields(): Array<Any> {
return arrayOf(os, token)
}
companion object {
fun of(os: String, token: String): Device {
return Device(os, token)
}
}
}
VO는 도메인의 필드가 될 수 있습니다.
CAKK-103
Entity 클래스 네임 suffix로 Entity를 추가했습니다. 도메인 모델 관련 추상 클래스도 구현해보았습니다. 각 추상 클래스에는 equals와 hashcode 메서드를 override 했습니다.
도메인 이벤트 발행 관련 메서드들을 템플릿에 맞춰 구현했는데, 어떻게 활용해볼지 생각해봐야겠네요