Blogs : Archives
|
|
| < TWiki looks at RIFE for inspiration | Continuations != continuations > |
|
RIFE has been supporting Groovy for element implementations, site structure declarations and conditional template blockvalues for almost a year. When Groovy announced that they were going to reimplement the language parser completely and redesign the features of the language itself, I was pretty scared about how the migration to the upcoming version would be. I finally took the plunge and upgraded to the latest version. To my surprise they were able to make these signification changes to the internals without changing the embedding API. That was already more than I expected! I really didn't have to change anything to RIFE at all! Even more, the bugs that I had reported were all fixed and I didn't have to make an exception for Groovy anymore with regards to the However, when running the tests I received a number of failures which are due to the minor backwards incompatible changes that the JSR version introduces. These are the differences that mattered to me: HeredocsInstead of using No support for splitting a single expression over several linesWe took the habit of using builders and chainable setters in Java, which allows us to write concise and intuitive code like this: builder
.enterElement("groovy/test_groovy2elementinfo1.groovy")
.setId("ELEMENT1")
.setUrl("/test/element1")
.leaveElement();
However, the current version of Groovy requires the dot and the method call to be on the same line as the object it's being called upon, so they above code has to become: element_builder = builder.enterElement("groovy/test_groovy2elementinfo1.groovy")
element_builder.setId("ELEMENT1")
element_builder.setUrl("/test/element1")
element_builder.leaveElement()
I find this a set-back and hope they'll solve this soon (bugreport). The property keyword has been replaced with an annotationI'm glad this was done since it's now possible to use the property literal in Groovy builders. Before I has to make an exception for RIFE's site structure and element structure declaration and rename ConclusionI think that the Groovy team has done a great effort in formalizing the language and still keeping backwards compatibility as good as possible. To everyone who is hesitant to upgrade or start using Groovy, I'd say, don't be! If there's a time to try it out, it's now! |
||||||
Comments |
||||||
|
||||||
|
||||||
Add a new comment |
||||||
|
||||||
| < TWiki looks at RIFE for inspiration | Continuations != continuations > |


