Home | Projects | Contact Me

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.

Comments
todd sharp's Gravatar Well to be fair, the beans scope was just added in MG3 and it's fairly less documented then previous versions of MG...so don't feel bad - I probably would have been a little tripped up too.
# Posted By todd sharp | 8/17/08 11:38 AM
todd sharp's Gravatar To clarify...less documented *so far* - after all it is still alpha I believe...
# Posted By todd sharp | 8/17/08 11:39 AM
Shane Zehnder's Gravatar Well, I did start off using MG:Unity since Dan Wilson has a great series on installing and writing apps with Unity. Still I had some issues there, mostly from my lack of understanding how things were tied together. For instance, in my ColdSpring config file I setup my instance of Transfer, but for the life of me I could not find my instance when I needed to reference it, if that makes any sense. Hopefully I will be able to bridge the gap I was having in Unity and actually be able to make it work in Gesture. I haven't quite gotten that far yet. ;)

I don't mind using a less documented framework as long as I have a working application to model. I will figure out what works and what does not and hopefully, why.

Besides, it has been enjoyable having a challenge for a bit.
# Posted By Shane Zehnder | 8/17/08 12:36 PM
Layout: Shane Zehnder ::: BlogCFC was created by Raymond Camden. ::: This blog is running version 5.9.