«« Next » « Previous
«« Next » « Previous

Link Details

Your votes power DZone. Login and vote now.
Link 82300 thumbnail

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.
  • 8
  • 1
  • 872
  • 211

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 (8)



Voters Against This Link (1)