Hi All,
I am working on an article about best practices to reduce Apex code size in an Org. If please share your experiences and any relevant documentation for the same.
In my experience, we made several changes to the Apex code within our project. Initially, there were functionalities achievable through Apex code which we transitioned to Flow. We also modified our approach, replacing some trigger-based error handling with validation rules. Furthermore, a significant adjustment involved a rollup summary operation on a parent object, where we replaced the previous Apex trigger mechanism with a rollup summary field.
During the implementation of OAuth 2.0, we optimized the process by reducing it from two requests to one. Initially, we made two separate requests for obtaining the access token and for making the actual request using that token. This was optimized using named credentials and authentication providers.
Finally, our integration with Amazon AWS S3 .Previously, we utilized an Apex class that had lots of details like headers, file format and some sensitive data for downloading files from AWS S3. However, we revamped this integration entirely by incorporating named credentials with Authentication Protocol as AWS Signature Version 4, resulting the class only making a GET request to download the file.
Hope this helps!