Categories
Contact Doug!
Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Web Hosting

<< May, 2013 >>
SMTWTFS
1234
567891011
12131415161718
19202122232425
262728293031
Search Blog

Recent Comments
Re: Disappearing IE Popup Window During Save/Open Dialog (by LZ at 4/20 7:58 AM)
Re: Create Dynamic WHERE Clauses in PHP (by pooja at 3/20 7:29 AM)
Re: Just What IS a 'Service Layer', Anyway? (by EugenK at 3/07 7:56 PM)
Re: Using Google as your CF Mail Server (by 5starwebteam.com at 2/25 1:27 AM)
Re: Why Provide for Service layer objects in CFWheels? (by Steven Benjamin at 1/25 11:43 AM)
Re: What is an 'Advanced' Coldfusion Developer? (by ColdFusion Developer at 12/24 5:14 AM)
Re: Equivalent of SQL "TOP X" in Oracle (by Ashenafi Desalegn at 12/06 5:29 AM)
Re: PHP Export to Excel Snippet (by serene at 12/05 1:44 AM)
Re: Just What Is 'Application Logic', Anyway? (by Arif at 11/13 8:06 AM)
Re: Hosts File Changes Not Acknowledged on Vista 64 (by Aaron at 10/22 2:31 PM)
Re: PHP Export to Excel Snippet (by Jafar Shah at 10/10 4:28 AM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Chenelle S at 10/04 12:53 PM)
Re: PHP Export to Excel Snippet (by Kilo at 9/26 5:20 PM)
Re: Porting Coldfusion Code to Mura (by tariq at 9/03 9:51 AM)
Re: Just What IS a 'Service Layer', Anyway? (by James at 8/27 4:06 PM)
Re: Calculating Business Hours (by helen at 8/14 2:54 AM)
Re: What IS 'Business Logic', Anyway? (by dougboude at 8/06 11:30 AM)
Re: What IS 'Business Logic', Anyway? (by Adrianne at 8/06 10:29 AM)
Re: Family Law: The Weapon of Choice for Woman Scorned (by dougboude at 8/04 4:39 PM)
Re: Family Law: The Weapon of Choice for Woman Scorned (by Lola LB at 8/04 7:43 AM)
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

07 September 2007
ModelGlue Development Cheat Sheet
When my team and I first began building our Model-Glue:Unity application, we experienced a GREAT deal of head scratching and frustration during the development process. We would alter a line here or there, refresh our browser, and NOT see the change. It took us quite some time to finally figure out what kind of action was warranted for what kind of change in order to make it manifest, so we documented it for ourselves in our local Wiki.

Following are the guidelines and shortcuts we came up with to make our development a wee bit less frustrating. I don't claim to have the market cornered on understanding all of the nuances and functionality of MG:U, so please, feel free to let me know about any changes or additions you feel would benefit those who read it.


ModelGlue:Unity - Modes of Operation

(Note: ALL of the settings required to perform the following functions reside within the Coldspring.XML file)

There are essentially two modes of operation in ModelGlue: Development and Production. What each of these modes entails is actually user-definable since MG provides several different options that can be associated with each. For instance, you can be running your application in "production" mode and yet still opt to display Model-Glue debugging information. For the purposes of this post, "Production" will imply that all options associated with development have been disabled and the application is configured to run at its maximum speed.


How to Toggle Modes


In order to toggle between development and production modes:
  • change the "reload" property in Coldspring.xml to "true" for development or "false" for production;
  • edit the "debug" property, setting the value to "true" for development or "false" for production;
  • ensure that the "Mode" property in the Reactor bean definition is set to the value "Production" for production, or "Development" for development;
<property name="reload"><value>true</value></property>
<property name="debug"><value>true</value></property>

<bean class="reactor.config.config" id="reactorConfiguration">
    ...
    <property name="mode"><value>development</value></property>
</bean>
settings for development mode

<property name="reload"><value>false</value></property>
<property name="debug"><value>false</value></property>

<bean class="reactor.config.config" id="reactorConfiguration">
    ...
    <property name="mode"><value>production</value></property>
</bean>
settings for production mode

Refreshing During Development

Because ModelGlue:Unity maintains some objects, values, and settings in scopes that aren't typically refreshed, certain types of modifications require certain actions in order to make them manifest. The following matrix covers the typical mods that require specific reset actions.
ModificationReset Action
Change to ModelGlue.xml (or any XML file included in Modelglue.xml)
  • Make sure the "reload" property in Coldspring.xml has a value of "true";
  • re-initialize the app by going to the url [app url]/?init=true (http://www.myMGapp.com/index.cfm?init=true)
Changes to Coldspring.XML
  • Make sure the "reload" property in Coldspring.xml has a value of "true";
  • re-initialize the app by going to the url [app url]/?init=true (http://www.myMGapp.com/index.cfm?init=true)
Change to a controller cfc re-initialize the app by going to the url [app url]/?init=true (http://www.myMGapp.com/index.cfm?init=true)
Change to a model cfc all changes should be visible real time...just refresh your page!
(note: IF the cfc you edited ALSO happens to be injected into a controller, then you'll have to follow the steps for "changes to a controller cfc")
Change to the database Reactor needs to be reset. This is accomplished by:
  • In the Colsdspring.XML Reactor Configuration Bean, make sure "Mode" is "development";
  • Make sure the "reload" property in Coldspring.xml has a value of "true".
  • If Scaffolding is being used, ensure that Scaffold is set to "true".
  • Once the settings are verified, reinitialize the application by going to the url [app url]/?init=true (http://www.myMGapp.com/index.cfm?init=true).
After the application finishes reinitializing, you will very likely wish to DISABLE scaffolding and set your reactor mode back to development, then RE-INITIALIZE again for those changes to take effect.

CRITICAL NOTE! Reactor is a LOT like Wendy's...it doesn't make till you order it. What this means is that, even though you may have reinitialized the app AND Reactor is in Development mode, that one little record object you needed to be recreated WON'T be recreated UNTIL you actually call the portion of your code that asks ModelGlue for it. SO, be sure you leave Reactor in Development mode UNTIL you get to the portion of your code that actually USES the object you were trying to refresh. Ya feel me?

relevant portion of Coldspring.xml file
<bean id="reactorConfiguration" class="reactor.config.config">
    ...
    <property name="mode"><value>development</value></property>
</bean>

<property name="rescaffold"><value>true</value></property>
Change to a View All changes should be visible real time...just refresh your page!
Change to Reactor Dictionary file (model/data/reactor/
Dictionary/[table name].xml)
All changes should be visible real time...just call your event again!

Again, any additions or corrections that need to be made to this matrix, please shoot me an email (via my funky resume) or leave a comment (if you can pass the Turing Test).

Doug out.



Posted by dougboude at 12:14 PM | PRINT THIS POST! |Link | 3 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

Re: ModelGlue Development Cheat Sheet
If you could provide a print view for your blog, that would be great. When I print out some of your posts, some of the codes get cut off at the end because of the horizontal scrollbar.
Posted by Lola LB on September 8, 2007 at 7:25 AM

Re: ModelGlue Development Cheat Sheet
Good job!

I also did a small writeup on reloading Model-Glue apps with an alternative way here:
http://boyank.blogspot.com/2007/09/howto-reload-model-glue-applications.html
Posted by Boyan on September 8, 2007 at 11:34 AM

Re: ModelGlue Development Cheat Sheet
Thanks Boyan! I like the approach you took...definitely ensures that EVERYTHING gets reloaded.
Posted by dougboude on September 9, 2007 at 2:41 AM

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

Seventeen plus Four equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!