What's in a name?
Sometimes we forget to stress the importance of naming guardrails when discussing guardrail design. Rule naming is one of the most crucial players in Pega Platform application design.
In my experience of interacting with various developers, I've noticed that following proper naming conventions is probably one of the most ignored areas in the Pega application development cycle. There are a good deal of rules which are heavily used during development, yet aren't paid much attention when it comes to naming conventions and consistency.
These rule types are Class, Activity, Property, Flow Action, and Ruleset.
It’s time to discuss some of the naming best practices or guardrails that developers should keep in mind while designing their application.
- Use nouns for class names, and always capitalize the first letter
- Avoid acronyms and write words out in their entirety for clarity
- Never use underscore
- Name related objects accordingly
- Use the same naming conventions for class groups as for classes
- Naming convention should start with a verb and also contain a noun to indicate what it does
- Use mixed case with the first letter in uppercase as well as the first letter of each word
- Avoid using generic names like Create and Approve
- Router activities should always start with To
Examples: ToTeamManager, CreateClassReference, GetFileLocation
- Naming conventions should be nouns or noun phrases that describe the property
- As mentioned for Activity, the first letter should be capitalized as well as the first letter of each internal word
- The names of pagelist properties should end with list, and pagegroup properties should end with group
Examples: FirstName, AccountNumber, CustomerList
- Use a verb plus noun convention
- Use pre if used with a pre-activity
- Use post if used with a post-activity
- Use val if used with a validate record
Examples: PrePlannedCampaign, PostActionCampaign, ValEligibleUsers
- Create a new ruleset with a top-level class that inherits directly from @baseclass
- Always begin your ruleset name with something that uniquely identifies your company and the business purpose
- Avoid the use of special characters such as dashes, underscores, plus signs, quotes
- Use names that make sense; easy to remember and are short and catchy
- Avoid using obscure acronyms
Apart from this, special care needs to be taken during the naming of case lifecycle management as well. Three of the very basic elements of case lifecycle are detailed below.
- Use nouns or gerunds as a naming convention
- Avoid using verbs which describe an action or a status
- Keep in mind that steps are a to-do list, so the naming convention should reflect this
- Use a combination of verb and noun
- The name should describe the step’s overall purpose
Examples: Verify Application, Send Correspondence
- Use a noun convention
- Avoid using nonspecific names
- For instance, in a financial services organization, there may be Auto Loan cases and Auto Accident cases. Getting immediate context from the transaction name is crucial
Keep in mind these basic guardrails for developers to follow while designing their application, solidified by easy naming conventions. It will help the team to recall the purpose of the rules just by seeing the names.