I see a lot of on prefixes which implies that they are callbacks, when they are not really callbacks but instructions. Best example I could find was
BasePresenter.onViewAttached(T view)
This is not really a callback, it's in fact a setter. It's an instruction to the Presenter to attach the view. A traditional attachView() name seems more appropriate.
Of course not a big deal, and mainly philosophical :-) Thoughts? I find it confusing. There are other similar, but more borderline, examples such as onInject() and onInitialize() on the BaseFragment, which also feel more like instructions rather than callbacks.
An opposite example is onViewWillShow(). That is an actual callback, so there the naming is fine.
I see a lot of
onprefixes which implies that they are callbacks, when they are not really callbacks but instructions. Best example I could find wasBasePresenter.onViewAttached(T view)This is not really a callback, it's in fact a setter. It's an instruction to the Presenter to attach the view. A traditional
attachView()name seems more appropriate.Of course not a big deal, and mainly philosophical :-) Thoughts? I find it confusing. There are other similar, but more borderline, examples such as
onInject()andonInitialize()on the BaseFragment, which also feel more like instructions rather than callbacks.An opposite example is
onViewWillShow(). That is an actual callback, so there the naming is fine.