3 ms·
Question: The author writes (as an example of his problems relying on classes): Well, some tables when updating need to do more than just “update” a record, s
by Pamar 7y ago
Question:
The author writes (as an example of his problems relying on classes):
Well, some tables when updating need to do more than just “update” a record, such as insert a log into a side table.
I do not understand exactly if there is a problem here, or anyway I do not understand what the Functional alternative would be.
Assuming this is a problem, I suppose we have three choices:
a) You have to provide implementation for two distinct methods:
- Update(...) and LoggedUpdate(...) (the latter calls the former and then logs the result, most probably).
b) You decide that update() implicitly logs maybe based on a global configuration or similar mechanism.
c) You provide a boolean flag as parte of the method signature update(log).
What would be the proper Functional approach here?
(Caveat - I have no experience with Functional programming)