Mosh, I think we're getting wrapped up too much in specifics. Let me back up for a
moment. First, XFA's are not required, only suggested. You can write an entire FB
app without a single XFA. They just offer some nice benefits, like:
keeping decisions about application flow in the realm of the architect.
keeping decisions about application flow out of any individual code file.
allowing you to change at runtime how the application behaves.
allowing for components that respond differently in different situations.
So, the decision on whether or not to use XFA's is a personal one. If you think this
is not worth the effort (though in reality the effort required is neglegible), then
you aren't required to use it.
Regarding reuse and the question of building up end content from smaller pieces, this
too is a decision, not a requirement. But having the ability to do this by adding a
single attribute to an XML element is pretty impressive, at least to me. Let me give
a more realistic example:
Someone calls the controller to execute the fuseaction "store.productDetails". The
store circuit is targeted, and the action productDetails is executed. productDetails
is a controller-level action so it doesn't do anything itself. Instead it invokes a
series of actions in the Model and the View to complete the user's request. In this
case, it might call the model to query for product details, and the view to output
those product details. Simple enough so far. But now...
We take the resulting formatted output and capture it in a variable called a content
component. So we have the formatted product details wrapped up in a variable. But
why stop there? The controller can call more fuseactions in the Model and View, maybe
to get recently viewed items, items similar to the current item being viewed, daily
specials, etc. All of these are called separately, each one is formatted, and the
formatted output captured in a content component variable. So we end up with a bunch
of these "building block" content variables. At the end of the request, we can call a
layout file that positions and outputs all of the content components, formats it with
global header and footer, navigation, breadcrumb trail, whatever.
The result is an extremely flexible layout. "Skinning" the site so that users can
customize the layout is now trivial. Altering the layout is trivial. Altering any
single component in the layout is trivial because each call is encapsulated. And this
is all done in the circuit.xml file like this:
<fuseaction name="productDetails">
<set name="xfa.addtocart" value="store.addproducttocart"/>
<set name="xfa.productdetails" value="store.productDetails"/>
<do action="m_products.getProductDetails"/>
<do action="v_pages.productDetails" contentvariable="pageContent"/>
<do action="m_products.getRelatedProducts"/>
<do action="v_sidebarBlocks.relatedProducts"
contentvariable="relatedProducts"/>
<do action="m_products.getRecentlyViewedProducts"/>
<do action="v_sidebarBlocks.recentlyViewedProducts"
contentvariable="recentlyViewedProducts"/>
</fuseaction>
You have one place to look to see what is happening, or to start making changes. And
this is as complicated as it gets...using an MVC approach and creating multiple
components to be used in the final output. And this is only one approach...you don't
HAVE to do it like this, but I personally think it's a pretty useful way to go about
building a page for the user.
Naturally there are ways to do this without Fusebox, but with FB4 it's all at your
fingertips, all you need to do is add the "contentvariable" attribute to your <do> tag.
Hopefully this example gets your wheels turning. But on the other hand, it might seem
too complicated if you aren't familiar with Fusebox. Again, I would invite you to
take a look at it for yourself and make judgements based on that. If you do, please
don't hesitate to ask the Fusebox community any questions you might come up with.
Regards,
Brian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4