------ art_21395_8242295.1156691440989 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/26/06, Trans <transfire / gmail.com> wrote: > > I was looking at Matz' Wild and Weird ideas [1]. He talks about > annotations at one point and gives this example: > > # @require: arg1 > 0 > # @overriding: true > # @visibility: public > def foo(arg1) > ... > end Matz' example doesn't show it, but one of the really nice reasons to have annotations is to interact with IoC and DI frameworks, so that the same code will have different runtime behaviors depending on the container it's deployed in, without invalidating any of your unit testing. Think of the tremendous benefit that EJB3 gets from Java 5's annotations. I have to say that overloading the comment syntax gives me the creeps (primarily because of its potential to break syntax-aware code-processing utilities), but the general idea is pretty good. Using annotations in this way takes a baby step towards "configuration" rather than "convention," which arguably is in tension with the prevailing ethos established by Rails. But then we're talking about Ruby, not Rails ;-). ------ art_21395_8242295.1156691440989--