http://seancorfield.github.io for newer blog posts." />

An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Entries Tagged as grails

cf.Objective() 2014 - call for speakers!

October 21, 2013 · No Comments

The cf.Objective() 2014 Call for Speakers is open until November 1st so you have just under two weeks to submit your topics. You can also vote for existing topic submission at that same link.

Right now we've only had two general CFML topics submitted (and seven ColdBox-related ones!) but there's a good number of JavaScript-related submissions - and remember that cf.Objective() has a dedicated JavaScript track in js.Objective(), as well as a mobile/front-end track so it's more than a CFML conference... but we still want to see a good spread of CFML topics!

And if you want to submit non-CFML web development topics that you think would appeal to a CFML / JS audience in terms of broadening their skills, you should do that too! Last year Scott Stroz did an excellent talk about Groovy on Grails, and I touched on some advanced CFML techniques inspired by other languages in my polyglot talk.

Note: when you submit a talk, please make sure to follow the guidelines outlined in this blog post about cf.Objective() 2014 submission format!

No CommentsTags: cfobjective · clojure · coldbox · coldfusion · grails · groovy · javascript · programming

Is Choice A Good Thing?

April 06, 2009 · 19 Comments

The last week has seen some big announcements in the CF world! On March 31st, Gert announced the open source release of Railo, the next day Mark Drew announced he has joined Railo as CEO of the new Railo UK and then this week Peter Bell announced that he has also joined Railo and will be heading up the new Railo US operation. I've been using ColdFusion since 2001, back when I worked at Macromedia and my team of Java and C++ developers first encountered CFML in the form of very early builds of what went on to become CFMX (6.0). We were pretty skeptical at first.

[Read more →]

19 CommentsTags: adobe · bluedragon · broadchoice · cfml-advisory · coldfusion · fusebox · grails · machii · microsoft · openbd · oss · railo

2008 in review

January 04, 2009 · 4 Comments

As "usual", I start the year with a round-up of the highlights of last year, based on things that I blogged. It's been a strange year for me. After (seven) years with Macromedia / Adobe and most of 2007 spent freelancing, I took a full-time job with a startup and hired some amazing CFers to be part of my team. I (finally) learned Flex (and AIR). I learned a new language (Groovy) and did a lot less CFML programming than I've done in years while at the same time joining first the Open BlueDragon Steering Committee and then the CFML Advisory Committee, as well as attending more ColdFusion-related conferences than usual (cf.Objective(), Scotch on the Rocks, CFUNITED, Wee Dram of Scotch, MAX).

[Read more →]

4 CommentsTags: adobemax08 · air · bacfug · bluedragon · broadchoice · cfdevcon08 · cfml-advisory · cfobjective · cfunited08 · cfunited09 · coldfusion · coldspring · edmund · flex · fusebox · grails · hosted · iphone · openbd · oss · personal · railo · ria · saas · scotch08 · tdd · weedram08

CFUNITED 2009 - Initial Topics Announced

December 23, 2008 · 2 Comments

Liz has announced the first round of topics for CFUNITED 2009. It's an interesting mix of speakers - some old, some new - and a broad spectrum of subject matter. After CFUNITED 2008, Liz has promised lots of changes and improvements and we already know that the venue is something special and an all-in-one location (addressing a bit complaint about the last few years' conferences). One of the new changes for 2009 is that a quarter of the content will be Flex/AIR related, acknowledging the growth and increasing relevance of these technologies to ColdFusion developers at large. Some of the highlights (from my point of view) of the topics announced so far:
  • Flex development with the Swiz framework - Chris Scott
  • Railo Open Source - Gert Franz
  • Groovy for ColdFusion Developers - Joe Rinehart
  • iPhone Apps + Adobe ColdFusion - Josh Adams
  • ColdFusion, Model-Glue, Hibernate, Spring, and Groovy - Ray Camden
  • AIR: Building Desktop Applications with Flex 3 - Rob Rusher
  • Hack Proofing ColdFusion - Shlomy Gantz
Definitely not your father's CFUNITED!

2 CommentsTags: air · cfunited09 · coldfusion · grails · iphone · modelglue · orm · oss · railo · ria · swiz

Caveat Container

November 07, 2008 · No Comments

I said that I'd blog about a couple of painful lessons learned and that's a bit overdue. Sorry, I went to Holland for a week! However, here's one of those lessons learned... If you work with containers in Java (collection classes), you'll find that they have a contains(obj) method. The idea is that you can quickly check whether a given object is already in the collection by saying:
if (myCollection.contains(myObject)) ...
In many cases, you'll find this "just works" because contains() has the same idea of "equal" that you do for your objects. That is, it checks whether that exact same object is a member of the collection. Unfortunately, there are situations where "the same" object might be a separate instance that just happens to have all the same data (or at least the same key data). That can happen pretty easily when you are working with an ORM (like Transfer - although in our case it's Hibernate). You may be manipulating an object with, say, id = 783 and ask the ORM to load it from the database (or cache) so you can work on the "original" object. If the object you were working with has become disconnected from the ORM's cached version, you will now have two instances of the "same" object. They are "equal" as far as you are concerned but contains() will not consider them the same and you might be surprised to see it return false when you know the object is in the collection! This happened to me. My unit tests all passed but they had no disconnected objects. The real application began to fail and it took me a while to realize why. For me, objects are "equal" if their id properties are equal (and they are the same type of course). In my Groovy domain objects, I define equals() to specify this behavior and Groovy conveniently calls equals() when I say objA == objB. Operator overloading is very useful (and easy) in Groovy and it can help make your code much more readable. Unfortunately (for me), Java's collection classes don't respect that when contains() is called. Fortunately, Groovy provides a fairly simple workaround. You can use the find() method and a closure to specify the filter. find() returns the first matching object - or null if no objects match. myCollection.contains(myObject) can therefore be replaced with myCollection.find { it == myObject } or, if you want to be explicit, myCollection.find { obj -> obj == myObject } Since CFML does not allow you to compare objects directly, you're always going to have to write your own equality method. That means that any collection-based operations you do must explicitly call the appropriate equality method so, hopefully, you won't fall foul of Java's very literal "equality" test for the contains() method. If you work across both Java and CFML tho', you'll need to bear this in mind.

No CommentsTags: grails

Hibernate and Inheritance

September 07, 2008 · No Comments

I'm already used to the magic that is Transfer and I can't imagine building a ColdFusion application without it. Adobe have said they're looking at integrating Hibernate into "Centaur" and showed some simple examples of how it might work in their keynote at CFUNITED (I expect we'll see more at MAX - you are going to MAX, right?). Hibernate is the de facto standard ORM for the Java world and it is very robust, scalable and feature-rich. We've been using Hibernate for a while to manage the persistence of our business objects and that has driven us toward Groovy for those business objects since, right now, you cannot use Hibernate with ColdFusion Components in any meaningful way and we didn't want to write all the verbose code that Java would require. A recent discussion on the Transfer mailing list has focused on how to model one-to-one relationships and why Transfer doesn't support them directly. This is one area in which Hibernate's features go far beyond what Transfer offers - and part of the reason for us to "switch" to Hibernate for future product development. Another modeling quandary when it comes to persistence is how to handle inheritance.

[Read more →]

No CommentsTags: grails · j2ee · orm

AIR and Groovy via Spring

August 10, 2008 · No Comments

As a fun way to while away a Saturday evening, I decided to look at Joe's Behavioral Analytics backend code to see if I could create a Flex-based AIR application that talked to services written in Groovy. There's not really much documentation out there to help so it was a very hit and miss experience but eventually I had a simple AIR application making a RemoteObject call to a Groovy class and getting data back. I'm going to have to talk to Joe about cleaning up the installation I've ended up with but here are the highlights (and I'll blog more about this once I have all the pieces cleaned up):
  • JBoss 4.2.3 GA installed as a Server in Eclipse (using the Web Tool Platform JEE stuff)
  • Spring framework 2.5.5
  • A Spring-based Flex factory that allows Flex Remoting to talk to objects via Spring (author Jeff Vroom)
  • Groovy - set up per Joe's recent instructions
  • BlazeDS providing the Flex Remoting service
Create a Dynamic Web Project in Eclipse and then unzip BlazeDS into it (per the BlazeDS installation docs). Add Spring and the flex.samples.factories.SpringFactory Java class. Configure Flex Remoting according to Lin's instructions to add the Spring factory:
<factories>
      <factory id="spring" class="flex.samples.factories.SpringFactory"/>
   </factories>
and the context loader:
<!-- Spring -->
   <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext.xml</param-value>
   </context-param>
   
   <!-- load Spring's WebApplicationContext -->
   <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>
and the destination for the RemoteObject:
<destination id="place">
      <properties>
         <factory>spring</factory>
         <source>placeholder</source>
      </properties>
</destination>
Create a Flex AIR project and define a RemoteObject that refers to the destination you just defined:
<mx:RemoteObject id="bcp"
         destination="place"
         endpoint="http://127.0.0.1:8080/bcpbackend/messagebroker/amf"
         >

      <mx:method name="test" result="testResult(event)" fault="testFault(event)"/>
   </mx:RemoteObject>
Add the placeholder bean definition to your applicationContext.xml file:
<bean id="placeholder" class="com.broadchoice.bcp.Placeholder"/>
com.broadchoice.bcp.Placeholder is a Groovy class that contains a test method (for testing it just takes a string and returns that string plus some additional text).

No CommentsTags: air · flex · grails

Grails and Flex

February 11, 2008 · 13 Comments

Most of us know by now just how easy it is to write Flex applications backed by ColdFusion. Adobe have done a lot of work to ensure that integration with ColdFusion is seamless. It's very impressive. Browsing through the Grails site, I noticed they have a plugin for Flex so I figured I'd try it out. Following the instructions, I installed the plugin (grails install-plugin flex) which took a fair while to fetch the plugin from the codehaus.org site and build it and install it into my project. Then I created a service class - a regular Groovy class - with just this one additional line:
static expose = [ 'flex-remoting' ]
It had a method, hello(), that returned a string. Then I put my main.mxml file in the web-app directory of my Grails project with these lines inside the mx:Application tag:
<mx:RemoteObject id="ro" destination="helloService"/>
   
<mx:Button label="Hello" click="ro.hello()"/>
<mx:TextInput text="{ro.hello.lastResult}"/>
You don't need to build the project. You don't need to set any paths in FlexBuilder. Just create the MXML file. Then I hit the MXML file in my Grails app: http://localhost:8080/bookstore/main.mxml Much churning ensued as the Flex app was compiled on demand and then up it came with the Hello button. Click. The return value from my HelloService.groovy hello() appeared in the text box. It's a trivial app but it showed just how incredibly seamless the integration is. It uses the Web Tier Flex compiler for on-demand MXML compilation and it automatically manages the destinations for you.

13 CommentsTags: coldfusion · flex · grails · oss

Grails - a first look

February 10, 2008 · 18 Comments

There's still a lot of buzz about Ruby on Rails and I've played around with it but I really don't like the Ruby syntax. I've tried a few different Rails packages and just find the experience... clunky. Lots of people are very excited about Rails and Ruby in general, especially with JRuby (Ruby for Java) now running Rails. In fact, Maxim Porges thinks JRuby has taken ColdFusion's place as the new web productivity layer for Java, after watching Charles Nutter demo JRuby at the acts_as_conference Rails conference recently in Florida.

[Read more →]

18 CommentsTags: coldfusion · grails