reactor
Thanks Tom! - Reactor nightly builds
Submitted by Doug Sims on Fri, 2006-08-18 19:05. coldfusion | reactorIf you are not on the reactor list you may have missed this:
Bleeding Edgers rejoice!
Tom Chiverton is providing nightly builds of reactor for those of you who cannot access the reactor subversion repository through WebDEV.
The builds can be found at
http://www.falkensweb.com/reactor.html
Thanks Tom!
and everyone else who makes the reactor list such a great resource.
Reactor mixed case gotcha
Submitted by Doug Sims on Mon, 2006-07-24 18:11. coldfusion | reactorIt has come up on the Reactor mailing list that since the Coldfusion XML functions are all case specific,
extra care has to be taken to be sure the db fields and the reacor.xml <object> definitions and subtags all match in case.
Care must also be taken when throwing custom validation messages.
<CFSET arguments.ErrorCollection.addError("emailAddress.emailAddress.NoAtSign") />Is different from:
<CFSET arguments.ErrorCollection.addError("EmailAddress.emailAddress.NoAtSign") />Which ever variation does not exactly match the dictionary.xml file for that object will throw an exception:
Message An error occured while Transforming an XML document.
Detail Empty expression!So after painstakingly making sure all the DB fields (dev and production) matched the object tags, that matched the validation error definitions, that matched the case in the dictionary.xml files, I mysteriously received the error again. But this time it worked in one place in the app, and not in another, both using almost identical code. The only difference was what the reactorfactory was passed as the object name.
Reactor.createRecord("emailAddress") />is not the same as:
Reactor.createRecord("EmailAddress") />I currenly develop mainly in coldfusion/IIS, but these three mixed case gotchas have really gotten me thinking about becoming more aware of case no matter what I am coding. Maybe I can make make case consistancy second nature before I switch languages/platforms and really need it.
Reactor - Using the field tag to to alias duplicate columns
Submitted by Doug Sims on Wed, 2006-07-19 15:55. coldfusion | reactorIt is mentioned in the Reactor docs that the <field> tag can be used within your object definitions to pretty up ugly column names such as txt_lastname or strCity, but it should also be noted it can be used to diferentiate between two tables which both have fields with the same name.
for example, if all my tables have a modified date timestamp
<object name="User">
<field name="ModifiedDate" alias="UserModifiedDate" />
<hasMany name="Task">
<relate from="Taskid" to="Taskid" />
</hasMany>
</object>
<object name="Task">
<field name="ModifiedDate" alias="TaskModifiedDate" />
<hasOne name="User">
<relate from="UserId" to="UserId" />
</hasOne>
</object>Then, when I am doing a join later, I can reference the modified dates correctly.


delicious
digg
reddit
technorati