fflib-apex-common
fflib-apex-common copied to clipboard
Accept fflib_ISObjectDomain instances for all methods that accept List<SObject>
trafficstars
Hello guys,
During the use of fflib in my project, every time I have to register records in UnitOfWork I have to do something like this:
fflib_ISObjectDomain accounts = getAccounts();
unitOfWorkInstance.registerNew(accounts.getRecords());
And I'd like to do:
fflib_ISObjectDomain accounts = getAccounts();
unitOfWorkInstance.registerNew(accounts);
As I mentioned, I think all methods that receive a List<SObject> instance could have an overload accepting fflib_ISObjectDomain.
The new methods would use the current implementation:
public void registerNew(fflib_ISObjectDomain domain)
{
registerNew(domain.getRecords());
}
Does it make sense for you? I'd be happy to contribute with this little improvement.
Cheers,