> Brian wrote:
>
> I was playing with the MVC pattern again last night and created some
> nice little shopping cart and product list circuits that use MVC. I
> have two questions:
>
> First, when breaking these down into Model, View, and Controller
> circuits, is it better to do this:
>
> parent
> model
> cart
> products
> view
> cart
> procucts
> controller
> cart
> products
>
> or this:
>
> parent
> mvccart
> model
> view
> controller
> mvcproducts
> model
> view
> controller
>
I think the latter implementation would handicap you from understanding
the true power of MVC. For example, this is how I might implement a
shopping cart in MVC.
parent
model
products
orders
view
catalog
cart
checkout
orderstatus
controller
shopper
There are no one-to-one-to-one relationships between the model,
view and controller circuits. Instead they all work together to
form the application.
> My second question is, did anyone ever find a way around having to
> reference queries and result sets using "caller.myquery" and in the
> output using "caller.myquery.productid"? Or is this just a
> side effect of the MVC setup and it must be that way?
Pass the query into the circuit as an attribute.
<cfmodule
template="#fusebox.rootpath##self#
fuseaction="catalog.showItems"
items="#attributes.items#">
Patrick
==^================================================================
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]
T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================