Your votes power DZone. Login and vote now.
By jsugrue
via architects.dzone.com
Published: May 22 2008 / 12:33
This trick was pointed to me (without the ThreadLocal part) by Rein Raudjärv, who saw it used in jMock.
The problem with Java “closures” aka anonymous inner classes being a tad too ugly is a well known one, but this semi-solution seems to be quite unused. Although you can apply the same principle for many situations it’ll work best for embedded DSLs.
Add your comment