these different functions are composed together like so
f1 -> f2 -> f3 -> f4 -> f5
I need to add two new functions fx and fy around f3 like so:
f1 -> f2 -> fx -> f3 -> fy -> f4 -> f5
so I need to pre-process the argument for f3 and then post-process the output from f3
here function fx makes a change and fy reverts the change back, but fy needs additional details from fx to be able to revert, to know what values to revert to for example
the problem is that function fx needs to produce two outputs
first: output that is needed by f3
second: output that is needed by fy
Question: How to share dependencies between functions that are not connected together direct, is there a spacial way/technique to solve this?
FYI, I'm using Java8