Consistent file naming helps keep Visualforce and Apex classes easy to recognize and find. I’ve seen many orgs with both the good and the bad. Below is a table with naming suggestions. Some of them are mine, but most came from a presentation that I found referenced in a Trailhead module. The presentation is by Vivek Chawla. I recommend looking it over because it covers a lot of good stuff. Thank you Vivek.
Apex and Visualforce Naming
- Avoid using underscores.
- Use full names where possible. Be consistent.
- Test class should be named for the class they cover, and the word “Test” should be appended to the end.
|Functional Type||Name Suffix||Examples|
|VF Controller Extension||ControllerExt||AccountCloneControllerExt|
|Model / Wrapper Class||Varies…||Accounts / AccountWrapper|
|Web Service (SOAP)||Ws||AccountToolsWs|
|Web Service (REST)||Rest||AccountToolsRest|
Workflow Rule, Field Update, and Email Alert Naming
Workflow Rules and their actions can also get unruly without consistent naming. Force365 published some good suggestions. Below are the ones that I refer to most.
[Object]: [Criteria Description i.e. Condition]
Field Update –
Set [Field] to [Value]
Email Alert –
Send [Template short description]