NO MORE CAREER
POLITICIANS!
Get Out Of Our House: Replacing congress with TRUE citizens!
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

best web hosting - top web hosting sites, thetop10bestwebhosting.com

Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 9,001
Doug's Books

Read (and recommend)

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Data Mining (Practical Machine Learning Tools and Techniques)
<< February, 2009 >>
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
Search Blog

Recent Comments
Re: Railo 3.1 on Windows Server 2008 and IIS7 - Part 3 of 3 (by Jon at 8/27 2:04 PM)
Re: Hosts File Changes Not Acknowledged on Vista 64 (by Spacy at 8/24 3:46 PM)
Re: THE DAY CFUNITED DIED (by ComboFusion at 8/23 10:50 AM)
Re: My Grandpa (by Tasha at 8/10 4:29 PM)
Re: Just What IS a 'Service Layer', Anyway? (by dougboude at 8/02 10:10 AM)
Re: Just What IS a 'Service Layer', Anyway? (by Isaac at 8/02 2:25 AM)
Re: PayPal IPN Coldfusion CFC (by Soyestudiambre at 7/25 6:12 PM)
Re: PHP vs COLDFUSION (by Tony Garcia at 7/17 11:24 AM)
Re: PHP vs COLDFUSION (by dougboude at 7/14 8:45 AM)
Re: PHP vs COLDFUSION (by Lola LB at 7/14 5:51 AM)
Categories
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!!!

2 plus 3 equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!