Why retrofit use reflection instead of APT to implementate the APIs ? #3670
-
Like the title, it's been an impenetrable question for me for a long time. |
Beta Was this translation helpful? Give feedback.
Answered by
JakeWharton
Apr 3, 2022
Replies: 1 comment 1 reply
-
A few reasons come to mind:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure either of those are strictly true.
I built an annotation processor-based Retrofit around the same time I built an annotation-processor based Otto around the same time I built Butter Knife in early 2013. The Otto one was thrown out because our event bus usage was minimal and did not foresee the widespread abuse of event buses that would soon follow. The Retrofit one was thrown out because it becomes way too hard to support all the dynamism that makes Retrofit powerful: different converters, different execution mechanisms (what would become adapters), and different HTTP clients (later to be removed). It also would have required exposing APIs to build
Type
s at runtime which at t…