tag:blogger.com,1999:blog-4110180.post3923234588711985347..comments2025-07-21T06:33:41.604-07:00Comments on Tapestry Central: Duh! Annotation values as constants, not literalsHoward Lewis Shiphttp://www.blogger.com/profile/04486596490758986709noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4110180.post-69070527173793086762007-04-26T13:58:00.000-07:002007-04-26T13:58:00.000-07:00Well, specifically: T5 IoC will not register this...Well, specifically: T5 IoC will not register this as an error until it realizes your service, at which point it will see the error, and identify the correct possible values.<BR/><BR/>T5 IoC has also tested to death this issue, which is why I would much rather lean on that code that endlessly write ThreadLocal-based code to accomplish the same thing. Less code == good (if you can trust it).Howard Lewis Shiphttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-49911307723343533192007-04-26T13:47:00.000-07:002007-04-26T13:47:00.000-07:00whereas @Scope("prthread") would not be caught unt...<I>whereas @Scope("prthread") would not be caught until runtime.</I><BR/><BR/>...if then. One of the major problems of the run-time validation which seems to be so popular is that it's REALLY tricky to tell if you've screwed something up. You have to make sure you have a unit test which hits the particular scenario and successfully fails in the case of your particular typo.<BR/><BR/>Worse, these kind of unit tests are notoriously heavyweight to write. For instance, in this case you'd have to have a pretty fancy unit test which involved firing off two different threads and interrogating them to find the difference: that's a lot of work. And if a unit test is a lot of work to write, it's all the more likely to be abandoned -- right when you needed it most!Robert Fischerhttps://www.blogger.com/profile/11541292319276574235noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-19060278586409358932007-04-24T12:45:00.000-07:002007-04-24T12:45:00.000-07:00Strangely, that part I knew.Strangely, that part I knew.Howard Lewis Shiphttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-61473026487263851842007-04-24T12:43:00.000-07:002007-04-24T12:43:00.000-07:00you can use Enums too.... seen in JPA g,krisyou can use Enums too.... seen in JPA <BR/><BR/>g,<BR/>krisUnknownhttps://www.blogger.com/profile/10851776695248123085noreply@blogger.com