Component naming 1. Naming standards for component types: The naming of components is similar to the naming of classes, except that it has a 3-character prefix. These prefixes are used to identify companies, individuals, or other entities. (Note that the 3 characters as the prefix should be lowercase.) For example, a clock component can be declared like this: TlxSchool= class (TComponent)2. Component unit: The component unit can only contain one main component, which means that it appears on the component palette. components. Other auxiliary components or objects can also be included in the same unit. 3. Registration unit: The registration process of components should be moved from the component unit and placed in a separate unit. This registration unit is used to register all components, property editors, component editors, wizards, etc. Component registration should be done in the design-time package. Therefore, registration units should be included in the design-time package rather than the run-time package. It is recommended that the registration unit be named like this: XxxReg.pas. Xxx is a 3-character prefix to identify a company, individual or other entity. For example: the registration unit in this book is named LxReg.pas. 4 Naming rules for component instances: The name of the component should be descriptive. Delphi does not specify a default name for the component. Unit naming uses a modified Hungarian naming convention. In this standard, the component name consists of two parts: the prefix and the attribute identifier. (1) Prefix of component: The prefix of component is mostly an abbreviation of the component type. For example: btn: TButtonedt: TEdit spdbtn:TSpeedButtonlstbx: TIistBox As shown above, the component type prefix is changed from the component type name. The following rules illustrate how to define a component type prefix: 1) Remove the T prefix from the component type name. For example: TButton becomes Button. 2) Delete all vowels except the first vowel. For example: Button becomes Bttn, Edit becomes Edt. 3) Compress double letters. For example: Bttn becomes Btn. 4) In case of conflict, add a vowel to a component prefix. For example: Add a vowel to the prefix of the TBatton component to become batn to distinguish the prefix of TButton. (2) Component property identification name: The component property identification name is a description of the component's intent. For example: a TButton component used to create a new form can be named BtnNewForm. A component for editing students can be named EdtStudent.