https://kotlinlang.org logo
#android
Title
# android
a

Ayden

06/28/2018, 6:19 AM
May I know what's the different between
model
and
repository
directory?
l

Lucas Ł

06/28/2018, 6:47 AM
There are no strict directory naming schemes. But I guess you're looking for an example or saw an example project. If you call your directory
model
I'd keep there only data classes, without any business logic. In the
repository
directory, I'd probably keep my repository interfaces, and maybe their implementations. Maybe even services and/or disk/mem caches that are used by them. It all really depends on what's the scope of the project, and what other patterns/architecture you're planning on using. On a side note I believe that you shouldn't try to force huge architectures and patterns if your project is small, unless doing so for educational purposes.
1
👍 5
a

Ayden

06/28/2018, 8:24 AM
@Lucas Ł Thank you for your explaination. I am doing this only because I want to know how to implement mvvm and concept. Because I read an article from Medium about people comparing MVP and MVVM. To deal with some small or medium project, people would go for MVP. And MVVM for big project. Recently the market in my country are looking for developer who know MVVM as well.
l

Lucas Ł

06/28/2018, 8:27 AM
Oh, for the last bit I didn't mean it in MVVM/MVP sense. It's a pretty "lightweight" concept. I mean it for things like clean architecture or full repository patterns, even using cache in some cases doesn't make much sense. 🙂 I'm working currently on a small-mid project and using MVVM with xml databinding, but that's mostly because that's what I know best (I have a background in Windows Phone/UWP development)
a

Ayden

06/28/2018, 8:40 AM
@Lucas Ł I see. I have 0 knowledge about Android. I just step into Android field no more than 40 days. I have been reading a lot of articles and implement them. I want to fully focus on Android and iOS development. Is that seem too greedy?
l

Lucas Ł

06/28/2018, 8:56 AM
Nah, I actually came to my company looking for a job as a backend c# dev, but got hired as an android dev with next to no experience and had to "catch up" pretty fast to meet our deadlines Reading a lot of articles is a pretty good source of information. Just remember that different people have different ideas and approaches to the same problem, so what you read on medium is not something you should follow 1:1. Try it out and see if it works for you, modify if you think you can improve it and dont try to find a single solution to all problems (using 1 pattern for all apps)
2 Views