CHAPTER 12 – PEAR STANDARDS – Classes

Class names are also prefixed with the package name, or may be the same as the package name. The rules for use of upper- and lower- case characters are the same for package names and class names. Here are some examples:

class Package_Name ... class Package_Name_OtherClass ... There is one exception to the "initial uppercase letter" rule for classes: Objects returned by factory methods and such may have a class name where the generated part of the class name is all lowercase. The factory implementa- tion may not always know the right capitalization, so if you always lowercase the variable part of the class name, you are safe. For example, the DB package uses this scheme for its driver classes, which are called DB_mysql, DB_oci8, and so on, rather than DB_MySQL and DB_OCI8.

Post Comment
Login to post comments