Julian A.
Julian A.

Reputation: 11470

What are some rules of thumb for naming classes that extend Android's Activity class?

I go back and forth about how to name activity classes. Activity seems to imply a verb, like EditContact, for example. But that seems more like what one would call the Intent that triggers EditContact. Should the activity be named ContactEditor instead?

Upvotes: 2

Views: 1170

Answers (2)

fredley
fredley

Reputation: 33931

I've worked with a few projects and there doesn't seem to be a set way of doing it, and generally I follow the golden rule of name something by what it does. In this case, ContactEditor would be better, save your verbs for functions.

Upvotes: 1

Peter Knego
Peter Knego

Reputation: 80340

Interesting question. There is no right answer to this.

Personal opinion: Activities represent "places" in my application, so I name them accordingly: UserSettingsEditorActivity, MainScreenActivity, etc..

Upvotes: 4

Related Questions