1 May 2012 01:21
Re: Late binding class names
Without knowing what you are trying to accomplish, I have to bee too critical, but have you though about doing something much simpler, using say the state patterns, and delegating this method to another "state" object. I'm particularly scared by the idea that the same object will have two different classes in two different threads. Andrew On 20 Apr 2012, at 12:27 , Sean P. DeNigris wrote: > How would I hook into the system, let's say during the execution of one > particular method (and whatever methods it calls recursively), and > substitute one Class for another, without effecting the rest of the system? >
Of course, in normal programming, your point would be well-justified, but in
this case, I'm implementing a test double library, so I specifically want to
protect the rest of the system while a TestCase partially stubs out the
functionality of a class (e.g. return a canned value for DateAndTime>>now).
But it seems that this would be too difficult, so I'll probably resort to
method wrappers. It's not as sandboxed, but it's much simpler.
Sean
--
View this message in context:
RSS Feed