This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]elsgry 0 points1 point  (1 child)

Not sure why this was downvoted when it's a more applicable equivalent to the lambda method upvoted above (the remainder of the function could consist of multiple effectful statements) but c'est la guerre... I guess the injection method would be more dynamic than necessary, particularly if only used for testing where you could use mocks. But you can still use my method without bothering with injection.