Skip to content

Why retrofit use reflection instead of APT to implementate the APIs ? #3670

Answered by JakeWharton
Goooler asked this question in Q&A
Discussion options

You must be logged in to vote

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 Types at runtime which at t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JakeWharton
Comment options

Answer selected by Goooler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants