Aug 11 2007

Model Glue Tips Part 2: Use Naming conventions for your Event Handlers.

Posted by Mark Drew at 10:00 AM
4 comments
- Categories: model-glue

Continuing from the previous post, I wanted to talk about naming conventions, I am sure everyone has a way of doing this and will argue (a bit like IDE or OS wars) till they are blue in the face. This is the way I try and do it, maybe because I started out using fusebox, but it makes sense to me. If you have split out your Model Glue file as mentioned in my previous post, you will already have event-handlers that deal with different areas of your application, why not do the same with the event handlers, then you can see exactly what you are dealing with. For example, if we are doing Security related functions (in my ModelGlue_Security.xml file) it makes sense to name the event-handlers something like "security.dologin" or "security.dologout" then you will be able to see exactly what part of the application you are dealing with. I hope this makes sense and is useful!

Comments

sal

sal wrote on 09/22/08 4:13 PM

part 3 coming up? perhaps some subapplications??

;-)

good series.

cheers
Mark Drew

Mark Drew wrote on 09/22/08 4:13 PM

I might touch on that, but I just wanted to give some tips, rather than some major insights in this series :)

MD
johann

johann wrote on 09/22/08 4:13 PM

I completely agree with a good naming convention for your event handlers. In the MG app that I work on every day, there are many "sub apps" within it and I don't know how we would have kept track of all the events without a naming convention like you mentioned. Also, we would probably have collisions on duplicate event names if we did not have a naming convention.

johann
Mark Drew

Mark Drew wrote on 09/22/08 4:13 PM

Naming conventions are indeed a "Good Thing (tm)". I think the first time I encountered this kind of thing was in Fusebox, of course it used the <circuit>.<fuseaction> which meant there were no collisions since it was all based on switches (and you cant have two case statements for the same variable)

Write your comment



(it will not be displayed)





Search Archives

Contribute


MD on Twitter

Categories

coldfusion cfeclipse personal apple cfconferences ukcfug model-glue webdev blogging cfunited railo coldspring cfobjective presentations adobe scotch on the rocks reactor lost jobs ajax eclipse flex model-glue frameworks max google podcast podcasting reference ask md fusebox getrailo cfml spam donations eventvalidation fusiondebug air blue dragon cloud development flying funny java microsoft music snipex tattoo tips apple aptana blog cfml derby eventguard graphic novels hosting itunes metrics open bluedragon rant wishlist apollo barcamp bolt cebit cfdevcon cfonwheels cfug codeshare codeswarm coldfusioncamp directing doh! firefox flash gadgets groovy jquery mdc mvc ooops pownce quack regex spry subversion tashr transfer webservices xml

Monthly Archives