yatatsu / AutoBundle

AutoBundle generates boilerplate code for field binding with android.os.Bundle
Apache License 2.0
135 stars 13 forks source link

Avoid reflection #6

Closed yatatsu closed 8 years ago

yatatsu commented 8 years ago

AutoBundle.bind(Activity) is easy interface. It lookups dispatcher class internally. For this interface, AutoBundle use reflection at first time(only one time). But even if one time, should avoid reflection. Should use FooActivityAutobundle.bind(Activity) instead above.

Piasy commented 8 years ago

Without reflection, there are lots of boilerplate code to write in every activity and fragment, maybe the overhead of the one time reflection invoke worth the code convenience.

yatatsu commented 8 years ago

@Piasy , Thanks for your feedback! I understand what you said. But it seems not to be redundant so much. AutoBundle.bind(this, bundle) to FooActivityAutoBundle.bind(this, bundle), isn't it? I think it is not enough to worth to use reflection.

yatatsu commented 8 years ago

In #9 , Revive dispatcher class without reflection.

Piasy commented 8 years ago

Creative solution! 👏