I make no secret that I like love Model-Glue. I will admit, if you do not have a decent grasp on Object-Oriented processes, Model-Glue might seem a bit over complicated, but sometimes it just saves so much time and effort.
One example of this happened yesterday. I am working on a project that uses Model-Glue. There was a requirements change for one part of the application. It wasn’t anything major. I needed to remove something that was appearing on one particular page, and move it to a different page. Now, if your application is well-architected, this will be an easy process, however, in this instance, I did not even need to move any ColdFusion code. All I had to do was move some XML blocks from one <event-handler> to another and re-initialize the application.
Here is what the original <event-handler> looked like, the snippets we are concerned about are in bold.
<event-handler name="DisplayEnd"> <broadcasts> <message name="CheckIfLoggedIn"> <argument name="redirectToEvent" value="LoginForm"/> </message> <message name="NeedToGetPageManager"/> <message name="NeedMessage"> <argument name="message" value="End"/> </message> <message name="NeedGraphicId"> <argument name="grahicId" value="End"/> </message> <message name="NeedAudioMessage"> <argument name="audioMessageType" value="ending"/> </message> </broadcasts> <views> <include name="topContent" template="display/dspMessageText.cfm"/> <include name="bottomContent" template="display/dspMessageGraphic.cfm"/> <span style="font-weight: bold;"><include name="audioMessage" template="display/dspAudioMsg.cfm"/> </span> </views> <results> <result do="DisplayLayout"/> </results> </event-handler>
What the highlighted bits of XML tell us is that when an event named ‘DisplayEnd’ is called, such as http://www.mysite.com?event=displayEnd, certain messages get broadcast, including ‘NeedAudioMessage’. When that message is broadcast, we are also passing along an argument with the name of ‘audioMessageType’ and a value of ‘ending’. (This is available inside of any Model-Glue controller by using arguments.event.getArgument(‘audioMessageType’). Lastly, it tells us that, among others, we are including a ColdFusion page named dspAudioMsg.cfm.
I will not get into the particulars of the code that exists inside of the controller, it merely checks certain conditions and then simply adds a value to the event if an audio message should be displayed.
The change was that instead of displaying this audio message on the DisplayEnd page, the client wanted it to be displayed on the GoalMet page. All I needed to do was remove the 2 highlighted XML blocks from the original <event-handler>, and move them into the new one. Since the logic that determined whether or not we needed an audio message had not changed, there was no need to change any of the ColdFusion code. The XML looked like this:
<event-handler name="GoalMet"> <broadcasts> <message name="CheckIfLoggedIn"> <argument name="redirectToEvent" value="LoginForm"/> </message> <message name="NeedToGetPageManager"/> <message name="NeedMessage"> <argument name="message" value="Congratulatory"/> </message> <message name="NeedGraphicId"> <argument name="grahicId" value="Congratulatory"/> </message> <message name="NeedAudioMessage"> <argument name="audioMessageType" value="ending"/> </message> </broadcasts> <views> <include name="topContent" template="display/dspMessageText.cfm"/> <include name="bottomContent" template="display/dspMessageGraphic.cfm"> <value name="xeNext" value="index.cfm?event=DaisyEnd"/> </include> <span style="font-weight: bold;"><include name="audioMessage" template="display/dspAudioMsg.cfm"/></span> </views> <results> <result do="DisplayLayout"/> </results> </event-handler> <event-handler name="DisplayEnd"> <broadcasts> <message name="CheckIfLoggedIn"> <argument name="redirectToEvent" value="LoginForm"/> </message> <message name="NeedToGetPageManager"/> <message name="NeedMessage"> <argument name="message" value="End"/> </message> <message name="NeedGraphicId"> <argument name="grahicId" value="End"/> </message> </broadcasts> <views> <include name="topContent" template="display/dspMessageText.cfm"/> <include name="bottomContent" template="display/dspMessageGraphic.cfm"/> </views> <results> <result do="DisplayLayout"/> </results> </event-handler>
Now, as long as the same conditions are met, we will get an audio message in the GoalMet event rather than the DisplayEnd event, all without writing or changing one line of CF code.
Comments on: "Reason #526 Why I Like Model-Glue" (51)
Loose coupling rules. It RULES! 😉
LikeLike
Okay… but if you’d used a different architecture, say a component-based non-XML MVC system, wouldn’t you still have just moved the method call from controller A to controller B?
Heck, even in a well-designed old-school CF application, wouldn’t you have just included or called a cfmodule from B instead of A? Again just moving a few lines of code/text?
Sorry, but given the result it still seems a bit over-complicated.
LikeLike
We just recently had code built on top of the Model-Glue and ColdSpring frameworks. I’d have to admit that Model-Glue is complicated and was intimidating (it sometimes still is).
Scott has an excellent point that really exposes the usefullness of Model-Glue. The keywords are “there was no need to change any of the ColdFusion code”. Yeah, so mostly any change can expose your system to bugs if the change isn’t handled correctly but when merely configuration is changed it’s magic. Code changes are usually always a more dangerous change for us.
We outsource most of our development to India, if it was up to me we wouldn’t but that’s besides the point. Everytime our India team fixes something there’s a 50% chance they will break something. Seriously, “the fix one bug open two is a process we’ve had to live with”. Model-Glue has already made our lives easier when dealing with our outsourced teams. One fresh developer was able to successfully make two pages with little code and instead Model-Glue configuration and both pages were bug free. Now, that’s just amazing!
LikeLike
Sony DCR-TRV320 Battery Charger
http://www.chargers-battery.net/chargers.php/7,62054,sony,dcr-trv320,charger.htm
LikeLike
[url=http://www.chargers-battery.net/chargers.php/7,62086,sony,mvc-fd5,charger.htm]Sony MVC-FD5 Battery Charger[/url]
LikeLike
Sony CCD-TRV408 Battery Chargerhttp://www.chargers-battery.net/chargers.php/7,62118,sony,ccd-trv408,charger.htm
LikeLike
Sony DCR-PC105 Battery Chargerhttp://www.chargers-battery.net/chargers.php/7,62150,sony,dcr-pc105,charger.htm
LikeLike
Sony DCR-TRV460E Battery Chargerhttp://www.chargers-battery.net/chargers.php/7,62197,sony,dcr-trv460e,charger.htm
LikeLike
http://www.chargers-battery.net/laptop-battery/acro-laptop-battery.htm
Acro Laptop Battery
LikeLike
Bsi Laptop Battery
http://www.chargers-battery.net/laptop-battery/bsi-laptop-battery.htm
LikeLike
Bsi NB8600 Battery, NB8600 Battery Pack
http://www.chargers-battery.net/laptop-battery/bsi-battery-146.htm
LikeLike
Sony DCR-TRV360 Battery Charger
http://www.chargers-battery.net/chargers.php/7,62195,sony,dcr-trv360,charger.htm
LikeLike
I believe that XML provide a good way to promote the ueser experience when people browsing the website based on HTML language. since the Web 2.0 is coming, what can remain the most customers? the answer is a delightful
Website, remember, no matter what the customer wants to buy, first feeling, second purchasing. and the key point is ueser experience.
———————————————–
http://www.toshiba-laptop-battery.com/toshiba-satellite-a70-seires.htm
LikeLike
Sony DCR-TRV360 Battery Charger
http://www.chargers-battery.net/chargers.php/7,62195,sony,dcr-trv360,charger.htm
LikeLike
Sony DCR-DVD201 Battery Chargerhttp://www.chargers-battery.net/chargers.php/7,62131,sony,dcr-dvd201,charger.htm
LikeLike
If you’re using Eclipse, you probably have an XML file editor like XMLBuddy, Aptana or the Web Standards Tools installed. It can be frustrating to debug a non-working app for hours only to realize that you made a mistake in your modelglue.xml!
By incorporating a DOCTYPE statement at the top of any model-glue XML configuration file, you can develop faster knowing that Eclipse will alert you to any problems in your file.
http://www.toshiba-laptop-battery.com/toshiba-satellite-m30-series.htm
LikeLike
Since most manufacturers focus their support on Windows and Mac users, users of other operating systems often are unable to receive support for these devices. However, open source products such as Cinelerra and Kino (written for the Linux operating system) do allow full editing of some digital formats on alternative operating systems, and software to edit DV streams in particular is available on most platforms.
Many low-end tapeless camcorders, however, do not support any operating system but Windows, requiring either third-party software or a switch to a more standardized format such as DV.
http://super-camcorder-battery.com/
LikeLike
http://www.digital-camera-batteries.net/canon.htm
http://www.digital-camera-batteries.net/canon/nb-2lh.htm
http://www.digital-camera-batteries.net/canon/bp-511.htm
LikeLike
New Original hp laptop battery — PB994A
save 40% off
http://www.hp-laptop-batteries.net/pb994a.htm
LikeLike
Discount battery shop supply laptop battery and camcorder battery.
http://www.discount-battery.org
LikeLike
http://www.power-batteries.net
http://www.laptop-battery-inc.co.uk
http://www.buy-batteries.net
Great laptop battery,camcorder battery,digital camera battery on US market & UK market.
LikeLike
http://www.power-batteries.ne: A leading supplier of rechargeable battery on US market.Specializes in laptop battery, camcorder battery, digital camera battery, external laptop battery, laptop battery charger, power supply adapter and camcorder battery charger.Offers camera/camcorder battery charger for sales. PDA Battery & Digital Photo Frame at low price. Power-batteries.net sells a wide range of batteries for Two Way Radio and MP3 player(includes IPOD).
http://www.laptop-battery-inc.co.uk
UK market battery seller, provides high quality & cheap laptop batteries for major notebook computer brands,such as ACER, COMPAQ,DELL, FUJITSU,HP,IBM,LENOVO,SONY,TOSHIBA; digital camera battery for CANON,FUJIFILM,KODAK,MINOLTA ,NIKON,OLYMPUS and SONY; Camcorder battery for CANON,HITACHI,JVC,PANASONIC,SAMSUNG,SHARP,SONY; Digital Photo Frame at great price; USB Bluetooth Adapter and laptop AC adapter.
LikeLike
http://www.buy-batteries.net
Specializes in rechargeable laptop batteries for ACER, COMPAQ,DELL, FUJITSU,HP,IBM,LENOVO,SONY,TOSHIBA;Offers discount camcorder battery for CANON,HITACHI,JVC,PANASONIC,SAMSUNG,SHARP,SONY; Brand new digital camera battery,provides best replacement for OEM camera battery, featured brands:CANON,FUJIFILM,KODAK,MINOLTA ,NIKON,OLYMPUS and SONY; AC adapter,laptop battery charger,camera battery charger are available from our online store.
LikeLike
i am tina from New Jersey,i work as a internet seller,my website http://www.cheap-digital-camera-batteries.co.uk , http://www.batteriescenter.co.uk , http://www.ibm-laptop-batteries.net http://www.usa-batteries.com are great online store where you can shop any kind of replacement battery at the lowest prices.Anyone who uses batteries of any sort, for any purpose may take advantage of my web page,good luck!
LikeLike
Battery -chargers.org supply many camcorder batteries,digital camera batteries and chargers with factory price,high quality,1 year warranty and 30 days money back!
http://www.battery-chargers.org/
LikeLike
http://www.upowerbiz.com/index.php?cPath=247_248
http://www.upowerbiz.com/index.php?cPath=247_249
http://www.upowerbiz.com/index.php?cPath=247_250
http://www.upowerbiz.com/index.php?cPath=247_252
http://www.upowerbiz.com/index.php?cPath=247_251
http://www.upowerbiz.com/index.php?cPath=247_252
LikeLike
http://www.batteries-store.ca/camcorder-batteries/jvc-bn-vf808.htm
http://www.batteries-store.ca/camcorder-batteries/jvc-bn-vf815.htm
http://www.batteries-store.ca/camcorder-batteries/jvc-bn-vf823.htm
LikeLike
http://www.espow.ca
LikeLike
http://www.discount-laptopbattery.com
LikeLike
Hi all,
I found an excellent SHARP vl-e720 battery at http://www.laptop-battery-inc.co.uk/camcorder-batteries/sharp-vl-e720.htm.
LikeLike
Hi,
http://www.rechargeable-battery.net/laptop-ac-adapter/acer-acernote-350.html
http://www.rechargeable-battery.net/digital-camera-batteries/sony-np-fc11.html
http://www.rechargeable-battery.net/laptop-batteries/apple-12.html
http://www.rechargeable-battery.net/digital-camera-batteries/casio-np-20.html
LikeLike
http://www.camcorder-battery.ca
http://www.camcorder-battery.ca/charger/casio.htm
http://www.camcorder-battery.ca/charger/casio-np-20.htm
http://www.camcorder-battery.ca/charger/casio-np-60.htm
http://www.camcorder-battery.ca/canon/bp-2l12.htm
LikeLike
http://www.laptop-battery.org.uk/laptopbattery/1001648.htm dell XPS M1530
http://www.laptop-battery.org.uk/laptopbattery/1001566.htm dell XPS M1330
http://www.laptop-battery.org.uk/laptopbattery/1001564.htm DELL Inspiron 6400
LikeLike
http://www.batteries-laptop-notebook.com/5171.htm
http://www.batteries-laptop-notebook.com/113.htm
http://www.batteries-laptop-notebook.com/883.htm
http://www.batteries-laptop-notebook.com/882.htm
http://www.batteries-laptop-notebook.com/664.htm
http://www.batteries-laptop-notebook.com/1149.htm
LikeLike
http://www.batteries-laptop.org/laptop-battery-dell.htm
http://www.batteries-laptop.org/laptop-battery-acer.htm
http://www.batteries-laptop.org/laptop-battery-apple.htm
http://www.batteries-laptop.org/laptop-battery-compaq.htm
LikeLike
Welcome to online laptop battery store, we offer high quality laptop batteries: Sony laptop battery, TOSHIBA laptop battery, Dell laptop battery, Acer laptop battery, Compaq laptop battery, HP laptop battery … … http://www.laptop-battery.org.uk/ Your need,is our eternal pursuit; Your satisfaction,is our high honour; Thank you for your support . http://www.battery-store.eu/
LikeLike
At espow.org we offer the widest selections of third party replacement batteries with the lowest prices, good battery life performance. Best laptop batteries – hp laptop batteries, ibm laptop battery, sony computer battery, dell laptop batteries, compaq laptop batteries, notebook desktop computer batteries…
http://www.espow.org
http://www.hp-laptop-batteries.com
http://www.battery-store.ca
LikeLike
Li-ion Dell inspiron 6400 laptop battery – 7200mAh 11.1V, spare or replacement for laptop power need, compatible many parts, It’s also an universal smart battery for Dell inspiron 6400, Dell GD761,Dell KD476 .Dell inspiron 6400 battery for most existing laptop parts, longer Dell INSPIRON 6400 battery life performance.no memory, don’t worry about the rechargeable frequently.
http://www.espow.org/laptop-batteries/dell-inspiron-6400.htm
LikeLike
Li-ion Sony np-bk1 digital camera battery – 550mAh 3.7V DC, spare or replacement for digital camera power need, compatible many parts DSC-S750, DSC-S780,no memory, don’t worry about the rechargeable frequently. Having good battery life performance. Increase the shooting time on your DSC-S750 and S780 Cyber-shot digital camera with this slim yet powerful Lithium-ion battery pack.
http://www.espow.org/digital-camera-batteries/sony-np-bk1.htm
LikeLike
Li-ion HP PAVILION DV9000 laptop battery – 7200mAh 14.40V, spare or replacement for laptop power need, compatible many parts, no memory, don’t worry about the rechargeable frequently. Having good battery life performance. It’s also an universal smart battery for HP PAVILION DV9000, PAVILION ZE5490US …
http://www.espow.org/laptop-batteries/hp-pavilion-dv9000-battery.htm
LikeLike
DELL TT485 computer batteries,Laptop Battery
Buy DELL TT485 Laptop Battery from battery-store.eu, brand new, one year warranty, full compatible with: DELL TT485
http://www.battery-store.eu/laptopcomputer/dell-tt485-1001566.htm
LikeLike
Li-ion Dell INSPIRON 8600 laptop battery – 6600mAh 11.1V (Compatible with 10.8V), spare or replacement for laptop power need, compatible many parts, no memory, don’t worry about the rechargeable frequently. Having good battery life performance. It’s also an universal smart battery for Dell INSPIRON 8600, INSPIRON 8600M SERIES, LATITUDE D800 SERIES, PRCISION M60 MOBILE WORKSTATION
http://www.espow.org/laptop-batteries/dell-inspiron-8600.htm
LikeLike
Laptop batteries,camcorder batteries,digital camera batteries …
http://www.espow.org
http://www.hp-laptop-batteries.com
http://www.battery-store.ca
LikeLike
http://www.cheap-camcorder-battery.us
LikeLike
http://www.battery-shop.org/dell-inspiron-laptop-batteries.htm dell inspiron battery http://www.battery-shop.org/dell-latitude-laptop-batteries.htm dell latitude battery http://www.battery-shop.org/dell-precision-laptop-batteries.htm dell precision battery http://www.battery-shop.org/dell-smartstep-laptop-batteries.htm dell smartstep battery http://www.battery-shop.org/dell-vostro-laptop-batteries.htm dell vostro battery http://www.battery-shop.org/dell-xps-laptop-batteries.htm dell xps battery http://www.battery-shop.org/sony-laptop-batteries.htm sony battery
LikeLike
I got the right info about toshiba portege 4000 battery on http://www.adapterlist.com/toshiba/portege-4000.htm toshiba portege 4000 battery ,i sure it will fit my notebook .
LikeLike
http://www.digitalcamerabattery.ca/digital-camera-batteries/canon-bp-511.htm
http://www.digital-camera-batteries.org/canon/bp-511-battery.html
LikeLike
If you want to buy some idear laptop betteries,you can see it from hp pb994a battery,It’s very cool.
LikeLike
it doesn’t not get into the particulars of the code that exists inside of the controller, it merely checks certain conditions and then simply adds a value to the event if an audio message should be displayed.
LikeLike
Good laptop batteries:
http://laptopsbattery.us/hp-pavilion-dv6000.htm
http://laptopsbattery.us/dell-xps-m1330-battery
http://laptopsbattery.us/sony-vgp-bps2c.htm
LikeLike
A wonderful place about digital camera battery at:
http://digital-camera-batteries.ca
Cheap laptop battery
http://www.cheap-laptop-battery.co.uk
http://www.sales-battery.com
LikeLike