And, I just saw an example where the cfc's are invoked
directly from the controller circuit xml file. This would seem to be one
step ABOVE placing them in a model circuit file... is this recommended at
ALL? So far, there appear to be three places to handle calls to the
CFCs:
1. in act files, called using a model circuit xml
file.
2. using <invoke> in the model circuit xml
file, or
3. using <invoke> directly in the controller
circuit xml file.
Can someone outline the pro's and con's of each of
these? Is there any MORE?
It seems that if you are going to use true MVC pattern, #3
is totally out, and #2 is iffy, based on what Simeon said - that without using
act files, all you can do is "invoke" and you wont have any additional error
handling going on. #1 is the most complex file-wise, but seems most true
to MVC, correct? Boy, #3 sure makes things "one layer easier" though...
but what kind of corners are you writing yourself into down the
line?
Am i splitting to many hairs yet?
:)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Funaro
Sent: Wednesday, August 16, 2006 8:49 AM
To: [email protected]
Subject: RE: [Reactor for CF] Fusebox 5 ExampleThe reactorFactory does a pretty good job of caching the objects that need to internally. By letting it do its job you dont have to worry about when objects need to be updated into your application scope. When you ask for a gateway from the factory, the first time it will create it if it needs to. Each request for it afterwards with get you a cached copy.
In most of my fb apps, I will just shortcut my calls by placing set calls in the xml of my model circuit. In general I consider this bad practice because (without lexicons and such) you cant catch errors and you have limited choices in what you can do from this point. But I often find that making the calls from the xml is "good enough" and that its very simple to move this into an act_ fuse at a later point if I need more control.--------------------------So Simeon, if I understand what you are saying, then i *ONLY* need the ReactorFactory in application scope, and it takes care of additional efficiencies like storing other things in application scope as needed?And, if I understand most of what else has been discussed here, then my model circuit will be one (or several) xml files for the model, all of which point to actX files, all of which will contain simply calls to reactor?What's troubling me at this point is the number of files I have to bounce around to, just to write one fuseaction...1. Create XML block in controller file2. Create XML block in model file, create one or more actX files, write code there3. Create XML block in view file, create one or more dspX files, write code thereThis amounts to having at least 5 files to work with at all times... three of which have the same name, but are in different directories. I've started getting used to this, but it still just feels like I'm bouncing around a LOT. Has anyone else felt this way, or am I just a sissy?Perhaps the fact that Simeon has felt the urge to 'break from best practice' by putting reactor calls right in the model XML file because it's "good enough" and really is faster - something I can identify with - is indicative of a potential problem with having to work with so many files at once... which for someone new to fusebox could be a source of confusion and frustration...?I know, I know, this is the nature of MVC... we're assembling encapsulated "modules" here... but it just feels a little heavy writing code nowadays... maybe I'll get used to it.m
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
