That depends... if you have a controller (like you would in MG or "listener" in M2) then this operation should go in your controller. :)

If not, it depends on how you're laying out your app. If you just have a page-based model (so that "/folder/myPage.cfm" is your URL) then yeah, you may want to put it in your view... only because you don't have anywhere else to put it. You COULD rig up a simple "switchbox" of sorts that checks for certain url/form variables and calls actions either on reactor objects or via another set of higher-level objects... you could call them "home built controllers". You'd have something like MyAppController with methods like saveUserData() that would use the CollectionBeanMaker and the Reactor objects to do the job.

Something like that I'd stick in Application.cfm and have it do the jobs before the views got involved:

<cfswitch _expression_="#url.action#">
<cfcase value="saveUserProfile">
<cflock name="SaveUser" type="exclusive" timeout="10">
<cfset User = application.Controller.saveUser(form,session.User)>
</cflock>
</cfcase>
{etc...}
</cfswitch>

I'll grant you this could get to be a LOT of work (and is why frameworks were built to begin with, to make this possible as generically as can be so it can be reused for many apps) but for small, simple little apps with no tremendous complexity this might work out ok.

HTH,
J


------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC

http://www.web-relevant.com

Member, Team Macromedia - ColdFusion


"That which does not kill me makes me stranger." - Yonah Schmeidler


On Feb 28, 2006, at 7:23 PM, Daniel Short wrote:

You're wandering into the responsibility of an MVC framework. 
Mach II and Model-Glue both support ways to do this (by 
making an event bean from your form/URL variables, using the 
record as a bean). It's *definitely not the responsibility of 
Reactor* to handle that sort of thing, in my opinion.

I think the CFC Doug offered is a good compromise if you're 
using Reactor without an MVC framework...

That makes sense then... I should leave this kind of work to my View in this
case? I have a feeling I need to take a harder look at the sample apps to
see where this type of business fits in given my newbie-ness with the MVC
world... I'll eventually be using Model Glue along with Reactor. At this
point I'm just trying to understand one at a time. Then perhaps I'll actualy
be able to hook them together :).

Dan





-- Reactor for ColdFusion Mailing List -- [email protected]



Reply via email to