Since I'd gone most of the way with the last iteration of my bookstore demo application by porting it to Model-Glue and ColdSpring, I figured why not keep going. This version adds the use of the Reactor ORM API.

The only catch now is that in order to use Reactor, I had to drop my "fake query" approach and move to using a real RDBMS. I chose SQL Server because I have it installed locally and its fairly common. The zip file includes the SQL script and some CSV files with the data in it. There are only three tables and a few rows of data, so it should be trivial for users of other RDBMSs to set it up. In lieu of that, I hope that the code itself will offer some help to users considering any or all of these frameworks.

The file is attached to this post (I'm trying out the Blog enclosures), but it is also always available in the Links pod in the right sidebar.

A readme is included but it's fairly straightforward: set up Model-Glue 1.1, set up ColdSpring, set up Reactor, and unzip the app to your web root. I'd be interested to hear from both new users as well as people with experience in these new frameworks. Please let me know what you think! Thanks.

Comments Comments (18) | Download Download | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 4838 Views

Comments

  • # Posted By Michael White | 4/14/06 10:14 AM

    that works for me since I have a SQL 2000 server at home. I wonder if the same script could work on SQL2005 express (which is free) Matt Woodard blogged about SQL 2005 express, and recently Criminal Intent did a tutorial on making the connection : http://www.orbwave.com/cfjboss/2006/04/connecting-...

  • # Posted By Michael White | 4/14/06 10:15 AM

    oops, i said criminal intent... i meant criminal development... don't know where my head was at

  • # Posted By Sami Hoda | 4/14/06 2:36 PM

    Brian,

    Great work as always. I haven't found a sample app that does that for Mach II. I've Mach II and CS, Mach II and Reactor, but not all 3 in one. If you've seen one, can you point me in the right direction. Better yet... umm.. now that the DB is there.. would you be able to port the Mach II version to all 3 as well?

    Again, great work!

  • # Posted By Matt Williams | 4/15/06 12:07 PM

    Brian,

    If you haven't already done it, I can do the Mach II port for Sami. I had a verson of one of my apps running on M2-CS-Reactor, so it shouldn't be difficult to do. I may also set up an MS Access DB to work with your sample. I'll work on it this weekend unless you say you've got it done already.

  • # Posted By Brian Kotek | 4/16/06 6:10 PM

    Matt I was actually visiting my parents this weekend so I didn't get this until just now. If you'd like to port it to Mach-II be my guest.

  • # Posted By Matt Williams | 4/16/06 6:28 PM

    Cool. I started, but may not finish for a couple of days. I got your MG-CS-Reactor version running. I noticed that when drilling into a product, none of the details showed up (product name, description, price). I do get them on the non-Reactor version. Do you get the details? Perhaps there is something funky with my install.

    I poked around the code a bit and noticed the DAO that Reactor creates doesn't have a 'read' function. The PersonRecord's load function calls it. No error is thrown because the abstractDAO defines it.

  • # Posted By Sami Hoda | 4/16/06 6:42 PM

    Look forward to it Matt!

    Sami

  • # Posted By Brian Kotek | 4/16/06 8:55 PM

    Matt, have to set primary keys on the tables? Reactor needs primary keys in order for the DAO/record stuff to work.

  • # Posted By Matt Williams | 4/17/06 2:47 PM

    Yo Brian. I have the mach-ii/ColdSpring/Reactor version working on my machine. Perhaps I could send it to you so there would be a second set of eyes on it. You should have my email from comments registration, so maybe you could send me your email.

    Doing this makes me feel a little more justified in a project I'm working on that uses the bookstore layout & css. I also used the Fusebox version a few months back when first learning that framework. What comes around goes around.

  • # Posted By philipp | 5/2/06 7:54 AM

    hi, i do not know why but i have problems to implement the bookstore. i get the error message "Xml bean definitions must contain 'id' and 'class' attributes!(DefaultXmlBeanFactory.cfc:136)". can anyone help me to solve this problem?

    philipp

  • # Posted By Brian Kotek | 5/2/06 9:18 AM

    Philipp are you using the latest bleeding edge release of ColdSpring from the ColdSpring CVS repository. It is required to use Reactor as a factory bean.

  • # Posted By Josen Ruiseco | 12/3/06 11:20 AM

    I ama new CF OOP user trying to reverse-engineer your application to help me learn. I just obtained the latest releases of everything and am getting the following error:

    Element MODELGLUE.ADDCONTROLLER is undefined in ARGUMENTS
    at cfAutoWire2ecfc1859985818$funcINIT.runFunction(C:\Inetpub\wwwroot\Coldspring\modelglue\AutoWire.cfc:85)

    Any ideas on what I need to do differently?

    Note: the latest version of everything today is quite different than the latest version of everything around the date of the post/comments.

  • # Posted By Brian Kotek | 1/4/07 10:05 PM

    I think you just need to remove the ColdSpring Autowire controller from the XML. The new versions of Model-Glue don't use this, and ColdSpring autowires automatically.

  • # Posted By xiaoxinwow | 3/13/07 2:32 AM

    FFXI GIL
    <p>Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,cheap wow gold,buy cheap wow gold,real wow gold,sell wow gold, ...
    Here wow gold of 1000 gold at $68.99-$80.99 ,World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy euro gold wow Cheap wow gold,cheapest wow gold store ... <a href="http://www.33game.cn"><strong>ffxi gil</strong></a> buy euro gold wow wow gold--buy cheap wow gold,sell wow gold.welcome to buy cheap wow gold--cheap, easy, wow gold purchasing.World of Warcraft,wow gold Super ...
    We can have your wow gold,buy wow gold,wow gold game,world of warcraft gold, wow Gold Cheap wow, Cheap wow gold,world of warcraft gold deal,Cheap WOW Gold ...

    Welcome to our website for you World of Warcraft Gold,Wow Gold,Cheap World of Warcraft Gold,wow gold,buy cheap wow gold,real wow gold,sell wow gold, ...
    Here wow gold of 1000 gold at $68.99-$80.99,World Of Warcraft Gold,buy wow gold,sell world of warcraft gold(wow gold),buy gold wow lightninghoof instock Cheap wow gold,cheapest wow gold store ...
    <strong>ffxi gil</strong> wow gold--buy cheap wow gold,sell wow gold.welcome to buy cheap wow gold--cheap, easy, wow gold purchasing.World of Warcraft,wow gold Super ...
    Wow gold- Gold for buy gold wow lightninghoof instock EU-Server: ...wow Gold EU: starting from 84,99?; 3000 WoW Gold EU: starting from 119,99?. wow Gold- Leveling Services: ...
    We can have your wow Gold,buy wow Gold,wow Gold game,wow gold, Cheap wow Gold, Cheap World of Warcraft Gold,world of warcraft gold deal,buy cheap wow gold,Cheap WOW Gold ...

    Here wow Gold of 1000 gold at $68.99-$80.99,World Of Warcraft Gold,buy wow Gold,sell world of warcraft gold(wow gold),Cheap wow gold,cheapest World of Warcraft Gold store ... </p>

  • # Posted By Brian | 7/26/07 5:23 PM

    This is a great example but you don't save! I wish this example would have the ability to add a product or order so you could see the processing of form data with maybe a sample validation example.

    This post is over a year old and still there aren't any MG with Transfer or Reactor examples of getting a form post, passing it to your manager/service, creating the bean and saving the data. So close, yet so far. :)

  • # Posted By udip | 4/15/08 3:21 PM

    Brian, I needed help with Reactor validation. I did look at Doug's blog which got me started.. http://www.dougboude.com/blog/1/2007/05/Custom-Val...
    But he doesn't really mention how to deal with date validation, such as if my database table has a date field and if I try to validate it using the above way it doesn't really work. I am guessing coz its a date in my bean object..(setter).. Have you ran into this problem? Can you offer some solution.. thanks..

  • # Posted By Brian Kotek | 4/15/08 5:40 PM

    I'm not really sure what you mean Udip. If the value in the bean is a date, and the column in the database is a date, what is the problem?

    You might get better or more help if you post to the Reactor mailing list as well.

  • # Posted By udip | 4/16/08 3:43 PM

    Brian, sorry I wasn't clear.. Lets make it simple.. Lets say I have a form and I need the user to enter a date, now lets say the user enters a string and not a date, then it errors. How do I validate this in reactor. Here is the error..

    Oops!
    Message The cause of this output exception was that: coldfusion.runtime.locale.CFLocaleBase$InvalidDateTimeException: test is an invalid date or time string..
    Detail
    Extended Info
    Tag Context C:\workspace\reactor\project\Dao\Users2Dao.cfc (340)
    C:\workspace\reactor\project\Dao\Users2Dao.cfc (15)
    C:\workspace\reactor\base\abstractRecord.cfc (154)
    C:\workspace\reactor\base\abstractRecord.cfc (137)
    C:\workspace\ModelGlue\unity\orm\ReactorAdapter.cfc (554)
    C:\workspace\ModelGlue\unity\controller\GenericORMController.cfc (165)
    C:\workspace\ModelGlue\unity\listener\Listener.cfc (51)
    C:\workspace\ModelGlue\unity\eventrequest\MessageBroadcaster.cfc (57)
    C:\workspace\ModelGlue\unity\framework\ModelGlue.cfc (387)
    C:\workspace\ModelGlue\unity\framework\ModelGlue.cfc (360)
    C:\workspace\ModelGlue\unity\framework\ModelGlue.cfc (331)
    C:\workspace\ModelGlue\unity\framework\ModelGlue.cfc (289)
    C:\workspace\ModelGlue\unity\ModelGlue.cfm (126)
    C:\workspace\ContactManagerMG\index.cfm (50)