> Good, and thanks. That clears up the name change. But what about the
method?
> I mean, before the XFA used to be set within the requested template, but
now
> it's set in the index.cfm.
not much of a change, really. By passing the XFA by reference rather than by
value, you can let the programmer, who in principle only has the Fusedocs to
go on, write his fuse without having to know exactly where the fuse will go
next, because in principle he doesn't need to know such info. (unless he is
writing the other fuse too, but that is incidental). So the value is more
easily set in the fusebox rather than in the fuse, and then the programmer
only need know that the fuse will exit to "#attributes.XFA.xfa-extension#"
which may have any number of different values, which will be set by the
Architect in the fusebox rather than the Programmer in the fuse.
a real life example: suppose after your app added a new book with the
"actAddBook" fuseaction that the app XFA'ed back to the "listBooks"
fuseaction. The client, who by the way pays the bills :), sees this and
says, 'you know what? typically after we add a new book we like to review
that info we just entered and sometimes change it a bit. Can you make it do
that, rather than going to a list of books which i then have to scroll
through to make small changes?" This is typical of a client comment, right?
The "almost-there-but-not quite" comment. Now, with the old method, you have
to involve both Architect and Programmer in making this change. You're
reaching into code which does exactly what it's supposed to (ie add a book)
to make a change about something having nothing to do with it. But once the
Book has been added does the actAddBook fuse really given a you-know-what
what happens next? No, it's done its job--it's the *fusebox* that has to
know to go to "editBook" fuseaction next rather than to "listBooks". So
that's where the value is set, in the fusebox. The Programmer of the
"addBook" fuse never has to be bothered again about that fuse and even more
importantly the fuse file itself (actAddBook.cfm) never has to be opened. If
you don't open the file you'll be hard-presed to break the code :)
well...at least for the add-a-book functionality :)
hey, remember when Hal converted everyone to use "#self#" or
"#request.self#" in CFLOCATIONs and FORM ACTIONs ? It is the same idea. You
give up very little but gain quite a lot.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists