-
Notifications
You must be signed in to change notification settings - Fork 107
New domain structure #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New domain structure #31
Conversation
Minimal upgrade with only fixing the compile issues.
Only changed the interface structure to the new fflib_IDomain and split the opportunities domain from the trigger handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 24 files at r1.
Reviewable status: 10 of 24 files reviewed, 1 unresolved discussion (waiting on @wimvelzeboer)
sfdx-source/apex-common-samplecode/main/classes/domains/Accounts.cls, line 52 at r1 (raw file):
} public void setDescription(String description)
@wimvelzeboer Why wouldn't you pass SOUOW into this Domain method? By not including SOUOW as an argument to this method, it means that we need to assume every Account was dirtied by this method and load them into the SOUOW (as your new AccountServiceImpl
does with registerDirty
) which will cause spurious updates to LastModifiedDate and SystemModstamp when SOUOW.commitWork()
is called. This is an undesirable side effect
I know that's how the old sample code for this scenario worked ... but now we've tried to separate concerns (Domain is a pure Apex class), we need to decide whether it's an anti-pattern or a recommended best practice to send SOUOW all the way down into the Domain to allow for more granular control of record updates.
Thoughts?
Hi @daveespo,
alternatively you can use chaining to clean it a bit:
This structure keeps the domain from knowing about anything else than itself and avoids making records unnecessarily dirty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm fine with this reasoning
Reviewed 14 of 24 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @wimvelzeboer)
Insignificant change to trigger workflow run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ImJohnMDaniel and @stohn777)
Apply new domain structure.
In the first commit the minimal changes are done to resolve compiling issues
The second commit contains the change to the interface structure, where domains are extended from fflib_IDomain
This change is