hsu-hsu / nimble-survey-app

This is an application that allows users to browse a list of surveys.
0 stars 0 forks source link

[Question] Technical choices concern #21

Closed minhnimble closed 7 months ago

minhnimble commented 7 months ago

It is great to see that you are working with standardized architectural practices from Google to create the application (UI and Data layers, MVVM, DI with Hilt, etc.) At the same time, I do have a few small clarifications on the following parts that I would like to hear more from you:

hsu-hsu commented 7 months ago

These days migrating to jetpack compose is a popular approach and it has advantages over using activity/fragment such as app size, build time. But it is still new and constantly developing solution and not all libraries and components are not compatible with compose.

On the other hand, I am still learning stage for the compose and I only build some small apps for testing so for the test I want to make it perfect. That is another reason I didn’t use compose for this code challenge.

But if I were requested to implement the application using compose, I am confident to deal with the request because I have beginner knowledge about the jetpack compose and through my development experience, I have to handle many changes in technology so I will be fine with this change, too. And also these days, I am in learning phrase so I can prioritize my time in learning jetcompose to be ready to apply.

hsu-hsu commented 7 months ago

For the error handling, I am sorry that I left it to do later and forgot about it in the previous submission. But now, in pull request #23 I handle the errors and the app will display a Toast message with appropriate information to the user when the APIs throw an exception.

hsu-hsu commented 7 months ago

Yes, wrapping const with Object is old-fashioned with Java-style. We can safely drop both class, object and companion object and use top-level vals in Kotlin. But I used an Object because I want to separate all the api routes and keep those together in one place.

hsu-hsu commented 7 months ago

I used Moshi because it is a small and light library compared to most of the other libraries. I manually handle the attribute because sometimes we want to change the variable name according to how we used it so I don’t want to be concerned with naming so I handle it like this.

minhnimble commented 7 months ago

Thank you for your answers, just one small additional concern on the JSON:API parsing topic as follow before we wrap up this ticket 🙏

I manually handle the attribute because sometimes we want to change the variable name according to how we used it so I don’t want to be concerned with naming so I handle it like this.

Have you ever had the chance to work with JSON:API formatted responses before in your previous projects? Do you know any fixed attributes that won't change the name in this format?

hsu-hsu commented 7 months ago

I mostly used moshi and gson converter library in my previous project. I don't have experience using JSON:API library over those. I only heard those libraries and have little knowledge about that topic for now.