Gabor Varadi
1 min readDec 10, 2019

--

That is definitely admirable, although in that case, I’d rather still name the interface LocalDataSource for example, as that’s what the DAO is, and that’s what I’m wrapping. But I’d also only wrap it if I actually add the second implementation: having 1 interface to wrap 1 class “to prepare for when we’ll replace SharedPreferences with SQLite for storing key-value pairs” is massive overkill, and you can use Extract Interface to extract interface anyways. If there IS a second implementation, then it’s okay, but in most cases, there is no second implementation — in which case there is no need for the wrapper.

--

--

Gabor Varadi
Gabor Varadi

Written by Gabor Varadi

Android dev. Zhuinden, or EpicPandaForce @ SO. Extension function fan #Kotlin, dislikes multiple Activities/Fragment backstack.

No responses yet