Let’s suppose you have some interface A and a class B implementing this interface. Suppose also that you want to wrap all method invocations on interface A and do something with them before passing them to class B. One of reasons you could need to do it is logging every method call to interface A. [...]
Beautiful casting gone bad
Recently I encountered a blog entry describing a “beautiful” way of making the code more readable by creating a gereric helper method to perform object casting. Today I want to share some opinions about this improvement and general thoughts about coding.
The premise
In essence author of this post was trying to solve following problem: imagine you [...]