AndyJarrett

Model Glue and Reator at UKCFUG - getAll()

I traveled into London again last night to see the Model Glue and Reactor, a winning combination presentation with Mark Drew as the speaker, compere, organiser and the general setting up guy.

The presentation lasted for 2 hours and covered everything from setting up your development environment, to creating the beginnings of a blog app using both frameworks. Mark started with a slide show presentation detailing the frameworks, explaining their relationships to each other and how they are used in the Model-View-Controller (MVC) pattern.

ModelReactor
ViewCFMX
ControllerModel Glue

After this he went through each of the frameworks separately, starting with MG and breaking down the nodes in the modelglue.xml (config file). This then lead onto Reactor, explaining that it is an Object-relationship modeling (ORM) framework. Basically it helps speeds up development but cutting out the need to create SQL statements, DAO's, and Active Records as it does all this on the fly. Using your reactor.xml file you create the links and relationships between you tables and Reactor does the rest.

After the theory we moved into coding which Mark was doing everything on a Mac Book pro - I gotta mentioned it as I bugged him about running anything and everything on it last night as i'm still thinking about getting one . This also meant that cause of the new intel chips he had to set up an extra mapping in the CF administrator which normally wouldn't actually be needed. Mark then went and setup a MG/Reactor environment straight from the .zip files you can download from the sites. There wasnt actually that much new there but it was nice to see it setup from scratch. The next hour or so was used setting up the MG events and listeners, then onto adding Reactor for the database interaction and I think at this point he really showed the power of Reactor. Using a cfc called formutils.cfc (which you gotta release Mark) he generated a form on the fly using the MySQL tables metadata available through Reactor. So if you deleted a field from you "Comment" table, refreshing the form would remove the field. He then proceed to update/insert blog posts and comments all by just setting up the relationships in the reactor.xml.

My write up I don't think has covered half of it really as Mark went into dumping a lot of the objects that MG and Reactor returned to show and explain what is available. Most of the objects in both frameworks have a getAll() method which Mark seemed to be hunting down and utilising everywhere but it did show and display that there are a lot of functions(methods) in these which are helpful but aren't necessarily in the documentation.

Overall it was a great presentation and well worth the trip up. It was also good to not rush off afterward and get a beer over at The Bull afterwards, shame though I had to go to get back to Waterloo before I could hit the vodka.