tag:blogger.com,1999:blog-20633170.post1305385586762809148..comments2023-11-03T10:08:09.830+00:00Comments on Graeme Rocher's Blog: Grails 0.4.1 out, Groovy just got more dynamicGraeme Rocherhttp://www.blogger.com/profile/12301973191113958910noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-20633170.post-19344129805674200182007-02-13T08:57:00.000+00:002007-02-13T08:57:00.000+00:00Hi Sam,Indeed you are correct, and it will be disa...Hi Sam,<BR/><BR/>Indeed you are correct, and it will be disabled by default within Groovy.<BR/><BR/>However there are many circumstances where you ARE in control of threading and the environment. In this case it makes sense to offer a simpler way to add dynamic features.<BR/><BR/>Categories, although helpful, are counter-intuitive for many. With regards to Ruby and Javascript, these languages also have problems when it comes to dealing with threads (green threads in Ruby, real threads in JRuby) and concurrent modifications of meta classes (prototype object in JS) <BR/><BR/>However when used sensibly (ie you do all of the method registration at startup time) there is little issue. It seems there is a unfounded fear of this in Groovy land. Sure you can shoot yourself in the foot, but as I keep saying "With great power comes great responsibility" ;-)Graeme Rocherhttps://www.blogger.com/profile/12301973191113958910noreply@blogger.comtag:blogger.com,1999:blog-20633170.post-13381361689191966502007-02-10T21:46:00.000+00:002007-02-10T21:46:00.000+00:00As the original contributor of Categories I'm surp...As the original contributor of Categories I'm surprised that this is going in. The reason we didn't add it the first time was because in a multithreaded world that Ruby rarely ventures into this kind of thing is very unpredictable whereas Categories had well defined behavior.Samhttps://www.blogger.com/profile/14121705654622595662noreply@blogger.comtag:blogger.com,1999:blog-20633170.post-49236466578793316172007-02-10T17:48:00.000+00:002007-02-10T17:48:00.000+00:00There are a number of differences between this and...There are a number of differences between this and categories. First this will change every class within the VM whilst categories only apply for the block which you use the use statement with:<BR/><BR/>use(MyCategory) {<BR/><BR/>}<BR/><BR/>Next there are limitations as to what you can do with a category in terms of adding contructors, static methods etc.<BR/><BR/>There are no such restrictions here.Graeme Rocherhttps://www.blogger.com/profile/12301973191113958910noreply@blogger.comtag:blogger.com,1999:blog-20633170.post-29709772297779091162007-02-10T08:12:00.000+00:002007-02-10T08:12:00.000+00:00Looks great. What's the difference between this an...Looks great. What's the difference between this and Groovy Categories?<BR/>MilanAnonymousnoreply@blogger.com