Patterns to deal with with functions that can have different kinds of results.
- by KaptajnKold
Suppose you have an method on an object that given the some input alters the objects state if the input validates according to some complex logic.
Now suppose that when the input doesn't validate, it can be due to several different things, each of which we would like to be able to deal with in different ways.
I'm sure many of you are thinking:…