Shane's ramblings
Discussions of Coldfusion, life, the universe, and everything

Home

Playing with the Glue, Again.

Well, yesterday I started looking at Model-Glue, Transfer, and ColdSpring again. After about 14 hours of playing around I am starting to understand the flow of writing MG applications. Also, examining the code for Ray's CFLib2008 project helped quite a bit.

One of the biggest sticking points with MG, when you are not very familiar with MVC architecture it can be frustrating. For example:

<cfcomponent output="false" hint="I am a Model-Glue controller." extends="ModelGlue.gesture.controller.Controller" beans="userService">

   <cffunction name="init" access="public" output="false" hint="Constructor">
      <cfreturn this />
   </cffunction>

   <cffunction name="getUsers" access="public" output="false" hint="I return a query of users" >
      <cfargument name="event">
      
      <cfset arguments.event.setValue("users", beans.userService.getUsers()) />
   </cffunction>
</cfcomponent>

Above is a simple controller with just one member, getUsers(). It works fine as is, but remove the beans="userService" in the component definition and you may find yourself speaking in tongues. Well, I was anyway. ;) I know it may be common sense for some of you, but it is the first time I have ever encountered it. If it wasn't for Ray's CFLib2008 code I would be speaking in tongues still.

I suppose I understand events and event-listeners and handling views. I suppose I need a better understanding of how to use my objects within the framework.

Against someones advice I was playing with Transfer and ColdSpring at the same time as well. Actually, these two apps were much easier to wrap my head around than writing MVC code. After seeing how easy it was to implement Transfer I could almost slap myself for being too stubborn to use it before.

Really I haven't done too much with ColdSpring as of yet as I don't have many components in my "learning application." There is always tomorrow.

Playing with Model-Glue

Well, as anyone who has spent any amount of time around me will tell you, I have been threatening to pick up a framework.  After three months or so of empty threats I have finally decided to put my money where my mouth is.  I decided to download Model Glue as quite a few people I have the utmost respect for endorse it so it was a no-brainer for me.

I will have to admit I did stumble a few times during the installation.  I was more worried about getting it installed than actually reading any documentation, needless to say it helps to RTFM.  However, Dan Wilson and Ray Camden were nice enough to point me in the right direction after a little well deserved ribbing.  Actually, Dan was nice enough to write this article about installing Model-Glue:Unity which made everything pretty clear.  I was just trying to make things more difficult, as usual.

Tomorrow I will begin playing with MG in earnest.  I am glad I took the plunge and quit talking about learning a framework and I finally am taking the time to do it.  Now I just need to do the same with my CFMX certification.