Hi Janet, I'd agree with you that you want to keep your view and model separate. So I would opt for doing the aggregates somewhere other than the view. But it might well be in between view and gateway, in a business object. That business object (CFC) could call the gateway and receive the information back, then do any other manipulations you want, before returning the aggregate figures, along with the original query, to the view. After all, the need for aggregate information is a "business" decision.
Point being, your data access objects, like gateways, need to be kinda dumb, too. All they're doing is working with the database, not really making decisions on what the user needs. That said, you may well be able to obtain your aggregate information (depending on exactly what you need) with database aggregate functions inside your query. All in all, I'd say: if you can get the information with database aggregate functions, do it. If not, work with the returned query data in your business object to create the aggregates. But definitely, keep it away from the view. And finally, in complete repudiation of everything stated above: don't be overly worried about doing something like a small calculation inside your view. Yes, separation of concerns is what you always strive for. On the other hand, it's your application. You can make your own judgments on whether keeping every little thing absolutely separate is really necessary, or an overcomplication. -- Thanks, Tom Tom McNeer MediumCool http://www.mediumcool.com 1735 Johnson Road NE Atlanta, GA 30306 404.589.0560 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264506 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4