Apex Consts
The Constants Framework provides a structured approach for managing constants in Apex.
Why Apex Consts?
- Request and Cache - Only necessary consts are saved in Apex memory.
- Consts Modules - Separated const classes per sObjectType or business logic. No more God class.
- Consts Entry Point - Access all your consts via the
Constsclass. - English-like Notation - Make your code clean with English-like notation:
Consts.ACCOUNT.TYPE.PROSPECT.
Quick Start
apex
Account acc = new Account(
Name = 'My Account',
Type = Consts.ACCOUNT.TYPE.PROSPECT,
Rating = Consts.ACCOUNT.RATING.HOT
);