Link Details

Link 82300 thumbnail
User 185351 avatar

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.
  • 9
  • 1
  • 1076
  • 213

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (9)



Voters Against This Link (1)