ANother way to do it is by passing a closure rather than the class . Then you can avoid using mirrors. e.g. Note that such solution, while very useful, may not be so elegant in case you had many parameters to pass.
ANother way to do it is by passing a closure rather than the class . Then you can avoid using mirrors. e.g. Note that such solution, while very useful, may not be so elegant in case you had many parameters to pass.