Skip to content

on prefixes #74

@Migge

Description

@Migge

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions