Flex bean wizards and Model Glue bean maker

I came across a problem which meant that the beans created with the Flex RDS plugging for Eclipse wasn't suitable for use with Model Glue.

If you use the new RDS feature to create beans you'll notice that the setters look like this:

view plain print about
1<cffunction name="setFirstname" output="false" access="public"
2returntype="void">

3 <cfargument name="val" required="true">
4 <cfset variables.Firstname = arguments.val>
5</cffunction>

Eclipse find replace dialogue box This is fine, but the problem with this is that the MG bean maker (CollectionBeanMaker.cfc) expects the name of the argument to be the name of the field, in this case "firstname".

I did post this on the MG List and Sean Corfield said he was going to see if this could be fixed for the next beta.

In the mean time if you have a large bean file the following regex code will clean of the cfc.

From the Find/Replace menu tick "regular expressions"

In the find dialogue box put

view plain print about
1<cfargument name="val" required="true">(.*?)(\n)(.*?)<cfset variables.(.*?) = arguments.val>

And in the replace box put:

view plain print about
1<cfargument name="$4" required="true">$1$2$3<cfset variables.$4 = arguments.$4>

You can find out a little more about regex and back validatin in Eclise here at Adam Howitt's Blog

Posted: 03-Apr-2006

View: 1926

Permalink: here

Comments

Andy, just wondering how you are using ModelGlue with Flex 2. Flex as the view with MG as the service/model layer? Can you give some basic details?

Regards
Ian

#1 Ian Welsh
10/Apr/06 5:31 PM

Hi Ian,

Im not using MG with Flex 2. To be honest I haven't had as much free time as I wanted to play around with flex 2 at the moment. Though personally I wouldnt use MG with Flex as its a thats not its main purpose. Personally i'd look at putting reactor in there. Simeon Bateman has a post of Reactor with Flex 2 (http://www.simb.net/blog/index.cfm/2006/3/20/Using...).

#2 Andy J
10/Apr/06 6:40 PM