Skip to content

Code Review Suggestions - Motakean#22

Open
motakean wants to merge 3 commits intomasterfrom
motakean_codereview
Open

Code Review Suggestions - Motakean#22
motakean wants to merge 3 commits intomasterfrom
motakean_codereview

Conversation

@motakean
Copy link
Copy Markdown
Collaborator

@motakean motakean commented Mar 5, 2023


It's important to seperate the column names with a "_" inbetween.

source: https://developer.android.com/training/data-storage/room/defining-data
@ColumnInfo(name = "start date") val startDate: String?,
@ColumnInfo(name = "prescription length") val lengthInDays: Int
@ColumnInfo(name = "start_date") val startDate: String?,
@ColumnInfo(name = "prescription_length") val lengthInDays: Int
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to seperate the column names with a "_" inbetween.

source: https://developer.android.com/training/data-storage/room/defining-data

Used kdot documentation to better understand what the data class is functioning as.
source: https://kotlinlang.org/docs/kotlin-doc.html#block-tags
@motakean motakean changed the title Update Medicine.kt Code Review Suggestions - Motakean Mar 5, 2023
* @property name; the name of the medicine
* @property strength; the strength of the medicine
* @property start_date; the date the patient started the medicine
* @property preciscription_length; how long the patient should take the medicine
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added kdoc documention to better help the functionality of the data class.
https://kotlinlang.org/docs/kotlin-doc.html#block-tags

Instead of using @query and deleteall, we can use a simple @delete and delete method to make the code more clear and concise.

Source: https://developer.android.com/training/data-storage/room/accessing-data
Comment thread app/src/main/java/com/medmapper/v33001/dao/MedicineDAO.kt
} No newline at end of file

@Delete
suspend fun delete(medicine: Medicine)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using @query and deleteall, we can use a simple @delete and delete method to make the code more clear and concise.

Source: https://developer.android.com/training/data-storage/room/accessing-data

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same suggestion appeared in a previously submitted code review.
When that occurs, only the first gets credit.

@motakean
Copy link
Copy Markdown
Collaborator Author

motakean commented Mar 5, 2023

Analysis of the program:
This program is medicine tracking app for patients to ensure they're taking their medicine on time and appropriately. It consists of files such as the DAO, DTO, a database, and view model.

Was the program available in UC Github on time?
Yes

Is the program documented/commented well enough for you to understand?
Overall, the program was documented well, but I added additional documentations/comments such as KDoc

Does the program compile?
No, the program did not compile for me.

Rationale behind your changes:
The suggestions given are mostly to imporve on documentation, readability, etc. When inputting data, especially with the column names, we have to ensure that there is an underline seperating the two words, and ensure that they are lowercase. Table and column names in SQLite are case-insensitive. As for the deletion, I would suggest just using @delete instead of @query to make it more simple to delete, and more easier to follow. I also implemented some KDoc so that reviewers, such as myself, may find it easier to understand certain things.

Sources:

https://developer.android.com/training/data-storage/room/defining-data
https://kotlinlang.org/docs/kotlin-doc.html#block-tags
[https://developer.android.com/training/data-storage/room/accessing-data

Links to three specific commits that you made to your own group's GitHub repository before the end of sprint deadline.
Fastovich/PlaceFinder@392a546
Fastovich/PlaceFinder@1e7b98d
Fastovich/PlaceFinder@f908d79

Three specific technical concepts that you learned from this code review:
-The use of SQLite to create databases with columns within code.
-Column names are required to have an underscore if there is spacing between the words.
-The proper use of Kdocumentation and how to use it in Kotlin.

@motakean motakean closed this Mar 5, 2023
@motakean motakean reopened this Mar 5, 2023
@discospiff
Copy link
Copy Markdown

The changes here are fairly minor; no need to merge this branch. I would harvest the updated database names (with underscores instead of spaces), and good KDoc practices throughout.

Also, the reviewer indicates that the project does not compile. Only code that compiles should be pushed to version control. So, if it does not compile, the group should focus on fixing that first, before making any additional changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants