Go nuclear with Reactor for Coldfusion
I’m sure, like me you get extremely bored of doing add,edit,delete,add,edit,delete,add,edit,delete. Well i’ve always been looking for a quicker way to develop this sort of code, yes you can create templates where you just fill in all the variables, but more often than not you end up re-writing the whole thing anyway. Well finally, bingo! i’ve found out what i was trying to do is called an “Inline Dynamic Database Abstraction” API. The API is called the reactor framework. It basically allows you to create a table in your database and from that table you can perform all your database queries on-the-fly. Another great feature is that you can create relationships between tables via a simple XML file with this easy syntax:
<object name=”mRegion”>
<hasMany name=”sys_countries”>
<link name=”mRegionCountry” />
</hasMany>
</object>
<object name=”sys_countries”>
<hasMany name=”mRegion”>
<link name=”mRegionCountry” />
</hasMany>
</object>
<object name=”mRegionCountry”>
<hasOne name=”sys_countries”>
<relate from=”country_id” to=”country_id” />
</hasOne>
<hasOne name=”mRegion”>
<relate from=”regionID” to=”regionID” />
</hasOne>
</object>
This bit of code basically says a region has many countries and they link via a table called mRegionCountry.
It’s a lot more powerful than this but so far this as deep as i’ve gone. I’ve started using it in one of my applications and so far it’s saved me bags of time. I won’t go into details but after lots of googling i’ve found some very good documents the Introduction to Reactor for Coldfusion is great starter guide and is explained very simply with good examples. Also the .doc file that comes with the download is very good. Take a look at the examples too.
I’ll be posting more code in the future as I go along.
No Comments Yet
Be the first to comment!