Use terminology applicable to the domain
If your users refer to their clients as customers, then use the term Customer
for the class, not Client
. Many developers make the mistake of creating generic terms for concepts when perfectly good terms already exist in the industry or domain.
Use abbreviations sparingly and intelligently This means you should maintain a list of standard short forms (abbreviations), you should choose them wisely, and you should use them consistently. For example, if you want to use a short form for the word number, then choose one of Avoid long names (15 characters max is a good idea) Although the class name Avoid names that are too similar or that differ only in case The variable names Capitalize the first letter of standard acronyms Names will often contain standard abbreviations, such as SQL for Standard Query Language. Names such as nbr
, no
, or num
, document the one you choose (it doesn't really matter which one), and use only that one.PhysicalOrVirtualProductOrService
might seem to be a good class name at the time (OK, I'm stretching it on this example), this name is simply too long and you should consider renaming it to something shorter -- perhaps something like Offering
.persistentObject
and persistentObjects
should not be used together, nor should anSqlDatabase
and anSQLDatabase
.sqlDatabase
for an attribute or SqlDatabase
for a class are easier to read than sQLDatabase
and SQLDatabase
.
联系客服