Hey guys :smile: Got a question for you; have you ...
# android-databinding
k
Hey guys 😄 Got a question for you; have you ever think about anti-patterns and patterns by using android databinding?
a
Sometimes the library itself feels like an ani-pattern🤦
Don't get me wrong I use it in all my projects but kinda makes me question binding expressions and custom adapters a lot
k
Yeah I was thinking about the same
m
custom adapters do rub me the wrong way sometimes, but that's maybe because they are hard to get right. I'd also caution that binding expressions should be simple. There's a lot of power in the expression language, and it can easily be abused. It makes much more sense to me to use MediatorLiveData instances to transform other live data properties to something suitable for the UX to consume.
👍 2
o
Yeah, binding expressions should be very simple. Both for the sake of testability and readibility, XML shouldn't contain any complicated logic. We should confine ourselves to things like setting data, getting data, setting a listener, may be simple formatting.. Things that would be boilerplate in application code.
👍 1
k
Thank you guys for your help; any of you have any thoghts on how the library impact the size of the app? I did some tests wich it doesn’t increase the size that significantly as someone on my local community suggested. It generates more methods of course but I didn’t consider them that much in order to impact the app.
My research
a
I didn't notice any problem with build time size or performance
👍 1
k
yeah me neither; I mean it would 100% generate methods but I wouldn’t consider something that negative