Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What names do you find yourself prepending/appending to classes regularly? [closed]

People also ask

How do you name your classes?

Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).

How do you name a data Class?

Data classes are often the easiest to name. Use the noun for the record you're trying to keep. You can optionally use a "Model" suffix to explicitly declare that your record only stores information.

How do you name a class in OOP?

Naming Scheme 2 Class names: concatenated words each starting with upper case. Objects: lower case separated by underscores. Ivars: lower case separated by underscores.


You can take a look at source-code-wordle.de, I have analyzed there the most frequently used suffixes of class names of the .NET framework and some other libraries.

The top 20 are:

  • attribute
  • type
  • helper
  • collection
  • converter
  • handler
  • info
  • provider
  • exception
  • service
  • element
  • manager
  • node
  • option
  • factory
  • context
  • item
  • designer
  • base
  • editor

I append pattern name at the end if i follow one (i.e. FooRepository).
Trying to avoid -Helper, -Manager, -Utils.


I use Provider and Helper a lot.


Util

  • EnumUtil
  • ParseUtil
  • StringUtil
  • etc ...