Open
Conversation
kongwoojin
reviewed
Dec 30, 2025
kongwoojin
left a comment
There was a problem hiding this comment.
고생하셨습니다!
전에 비해서 확실히 실력이 느신게 보이네요
몇가지 피드백을 드리자면
- 현재 구조는 클린 아키텍처를 따른다고 보기는 어렵습니다. 클린 아키텍처는 domain layer가 필수지만, 현재 구조상 data 와 presentation 레이어만 존재하고, Repository와 Usecase, DataSource도 없네요.
- 의존성 주입을 사용하는 것이 좋습니다.
AndroidViewModel을 사용하신 이유가Room에 context를 주입하기 위해서일텐데,AndroidViewModel은 사용을 지양하는 것이 맞고, 결국 의존성 주입을 사용하면 해결이 가능합니다. - 이건 팁인데, 사람들이 클린 아키텍처랑 앱 아키텍처에 대해 많이 헷갈려합니다. 이것도 한번 어떤 차이점이 있는지 알아보시면 좋을 것 같아요.
Comment on lines
+22
to
+23
| viewBinding = true | ||
| dataBinding = true |
There was a problem hiding this comment.
여기서 질문! viewBinding과 dataBinding은 무슨 차이일까요?
| suspend fun delete(word: WordEntity) | ||
|
|
||
| @Query("SELECT * FROM word_table") | ||
| fun getAll(): LiveData<List<WordEntity>> |
There was a problem hiding this comment.
LiveData는 안드로이드 생명주기를 인식하고 있는 클래스입니다.
따라서, 안드로이드 생명주기 밖에서 동작하는 data layer에서 사용하기는 부적절해보입니다.
Comment on lines
+60
to
+64
| intent.putExtra(EXTRA_WORD_ID, word.id) | ||
| intent.putExtra(EXTRA_WORD, word.word) | ||
| intent.putExtra(EXTRA_MEANING, word.meaning) | ||
| intent.putExtra(EXTRA_IMAGE_PATH, word.imagePath) | ||
| startActivity(intent) |
| private lateinit var wordViewModel: WordViewModel | ||
| private var wordId: Int? = null | ||
| private var selectedImageUri: Uri? = null | ||
| lateinit var pickImage: ActivityResultLauncher<String> |
|
|
||
| if (wordId != null && wordId != -1) { | ||
| val wordEntity = WordEntity( | ||
| id = wordId!!, |
There was a problem hiding this comment.
wordId != null이 선언되었으니 타입 추론이 되지 않나요?
| import data.WordEntity | ||
| import kotlinx.coroutines.launch | ||
|
|
||
| class WordViewModel(application: Application) : AndroidViewModel(application) { |
| androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomCommonJvm" } | ||
| androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomCommonJvm" } | ||
| androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomCommonJvm" } | ||
| coil = { module = "io.coil-kt:coil", version.ref = "coil" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.