Configuration, Naming pattern

[ART-003] Bunch Of Naming Patterns


Before starting any implementation, one should establish a good homogeneous naming pattern for every component. It helps identify components quickly without struggling with some hazardous naming. All should be written in English and translation workbench should be used to give the correct output to the end user.


Guidelines

First letter of each word is in uppercase and the following are in lowercase.

Avoid using special characters in API name.

Use “_” as the separator.

Batch

ComponentBatch Scheduler
NameAPSXXX_SchedulerName
Ex: APS001_ExampleScheduler
ComponentBatch Job
NameAPBXXX_BatchName
Ex: APB001_ExampleBatch

Scheduler and Batch should share the same increment number, if there are more than one scheduler per batch then you should add a suffix to the scheduler name.

Webservice

ComponentName
Webservice RessourceWSXXX_WebserviceName
Ex: WS001_ExampleService
Webservice RequestWRPXXX_WebserviceRequest
Ex: WRP001_ExampleRequest
Webservice ResponseWRPXXX_WebserviceResponse
Ex: WRP002_ExampleResponse

VisualForce

ComponentName
VisualForce ComponentCXXX_ComponentName
Ex: C001_Example
VisulaForce PageVFPXXX_PageName
Ex: VFP001_Example
VisualForce ControllerVFCXXX_ControllerName
Ex: VFC001_Example
VisualForce WrapperWRPXXX_WrapperName
Ex: WRP001_Example

Controller and Page should share the same increment number, if there are more than one page per controller then you should add a suffix to the page name.

A wrapper is an aggregation of information to display on the VisualForce page.

RecordType

ComponentRecordType
LabelWord1 Word2
Ex: Person Account
NameObjectName_Word1Word2
Ex: Account_PersonAccount
DescriptionFree Text
Ex: RecordType to represents person account

Page Layout

ComponentPage Layout
NameObjectName – Word1 Word2 Layout
Ex: Account – B2C Layout

Process

ComponentProcess
LabelWord1 Word2
Ex: B2C Process
DescriptionFree Text
Ex: Process to describe B2C process

Role

ComponentRole
NameBranch/hierarchy – Word1 Word2
Ex: FR – Sales Rep

Folder

ComponentFolder
LabelWord1 Word2
Ex: France – Portfolio Management
Unique NameWord1Word2
Ex: FrancePortfolioMgt

Email Template

ComponentEmail Template
NameObjectName – Word1 Word2
Ex: Account – Owner Notification
Unique NameObjetcName_Word1Word2
Ex: AccountOwnerNotification
DescriptionFree Text
Ex: Notification sent to the owner of the account on each event

Validation Rule

ComponentValidation Rule
NameObjectName_VRXXX_Word1Word2
Ex: Account_VR001_StreetIsMandatory
DescriptionFree text
Ex: The field Street must contain a value.
Error MessageFree text
Ex: Please fill the Street field.

Custom Button / List view / Link

ComponentCustom Button, List view or Link
LabelWord1 Word2
Ex: Create New Offer
NameObjectName_Word1Word2
Ex: Account_CreateNewOffer

Home Page Component / Tab / App

ComponentName
Home Page Component LabelWord1 Word2
Ex: Welcome Page
Tab DescriptionFree Text
Ex: Tab representing list of accounts
App LabelWord1 Word2
Ex: Call Center
AppNameWord1Word2
Ex; CallCenter
App DescriptionFree Text
Ex: Group of tabs to manage Call Center functionnalities

Worflow Rules

ComponentWorkflow Rule
NameObjectName_WFXXX_Word1Word2
Ex: Account_WF001_UpdateCity
DescriptionFree text
Ex: Update the field City on each update.

Lightning Component

ComponentName
CMPLCXXX_ComponentName.cmp
Ex: LC001_Example.cmp
CSSLCXXX_ComponentName.css
Ex: LC001_Example.css
SVGLCXXX_ComponentName.svg
Ex: LC001_Example.svg
Controller JSLCXXX_ComponentNameController.js
Ex: LC001_ExampleController.js
Helper JSLCXXX_ComponentNameHelper.js
Ex: LC001_ExampleHelper.js
Renderer JSLCXXX_ComponentNameRenderer.js
Ex: LC001_ExampleRenderer.js
AppLCAXXX_ApplicationName
Ex: LCA001_ExampleApp
Apex ControllerLCCXXX_ComponentNameController
Ex: LCC001_ExampleController

Process Builder

ComponentName
Main Process BuilderObjectName_PBXXX_Main
Ex: Account_PB001_Main
Invocable Sub Process Builder ObjectName_PBXXX_Sub_XXX
Ex: Account_PB001_Sub_003

Flow

ComponentName
Object FlowObjectName_FLOW_XXX_ProcessName
Ex: Account_FLOW_001_CreateChildStore
Process FlowProcessName_FLOW_XXX
Ex: OrderQuickProcess_FLOW_002

Custom Object

ComponentCustom Object
LabelWord1 Word2
Ex: Account Criteria
NameWord1Word2__c
Ex: AccountCriteria__c
DescriptionFree Text
Ex: Criterias to apply for each account
Child Relationship nameObjectName(s)
Ex: Contacts

Custom Fields

ComponentCustom Field
LabelWord1 Word2
Ex: Total Amount
NameWord1Word2__c
Ex: TotalAmount__c
DescriptionFree Text
Ex: Amount calculated by external system
Technical Field Name & LabelTECH_Word1Word2

Technical fields should never be displayed on layout.

Apex Class

ComponentName
Service ManagerSMXXX_ServiceName
Ex: SM001_BillingProcess
Entity ManagerEMXXX_EntityName
Ex: EM001_Account
Data ManagerDMXXX_EntityName
Ex: DM001_Account
Trigger ManagerAPTXXX_EntityName
Ex: APT001_AccountTrigger
TriggerEntityNameTrigger
Ex: AccountTrigger
Utility ClassAPUXXX_UtilityName
Ex: APU001_StringUtils
Test ClassClassNameToTest_TEST
Ex: EM001_Account_TEST
Dependent Mock ClassMCK_ClassNameToMock
Ex: MCK_DM001_Account
Independent Mock ClassMCKXXX_MockName
Ex: MCK001_BillingService
Dependent InterfaceITF_ClassNameToInterface
Ex: ITF_DM001_Account
Independent InterfaceITFXXX_InterfaceName
Ex: ITF001_GlobalAccount
WrapperWRPXXX_WrapperName
Ex: WRP001_Request
Test FactoryTestDataFactory
ExceptionEXCXXX_ExceptionName
Ex: EXC001_CalloutException
Cache Builder or Custom Cache handlerAPCXXX_CacheBuilderName
Ex: APC001_UserInfoCache
Process Invocable ControllerPICXXX_ControllerName
Ex: PIC001_ExampleController

Conclusion

It was a long read if you reach this point, not the most exciting topic but it’s the basis. I haven’t covered every component but you have the idea and should be able to deal perfectly with the remaining ones. Remember that it’s important to settle naming pattern, not necessarily mine, but it has to be consistent and easy to remember and apply.

Hope you enjoy reading this article, see you soon for the next one ...

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.