Unit Of Work Utility for Salesforce Apex
I am a big fan of FFlib for Apex, however I needed something a little bit more lightweight and dynamic.
This utility allows the following:
- Register SObject Types in the order you want it to be processed and additionally include an External Id field you want to be used when performing the upserts.
- Register SObject Records to be Upserted (Insert and Update)
- Register SObject Records to be Deleted
- Register Relationships that should be resolved before DML
For examples check the test class.