Hello Chaps, Iâm new to the world of MVC, and Iâm currently using MG to initiate myself into this type of design pattern, and on the most parts Iâve now found my feet, but there are a few of the more simple concepts that Iâm still a little fuzzy on.
The first element that confuses me is this use of âviewsâ and how I should be applying them to me project. Should I be creating a view for every page in my application, or is the idea that each view forms a âwidgetâ and then pages can be assembled from several views? For instance, in my application I have a short list of âlatest newsâ type features, which I want to display on several different pages around the site. Do I need to replicate this code every time for each view, or do in include it with <cfinclude> ,or can I have the framework assemble it for me into the pages? Before I moved to MVC I would always construct âwidgetsâ of information and then build my main pages with nothing more than several <cfinclude> to bring in the data I wanted. Iâve downloaded several model glue based applications off the web, and none of them seem to shed much light on the situation, many of them seem to have plenty of CFM pages outside of the âviewsâ folder which contain queries as inline code which obviously goes against the whole principle of MVC and OOP methodology. Is there any particular reason they would be doing this? Itâs got me stumped. Next I wanted to quickly cover the process of retrieving query data into my view. On occasion I find myself needing un-manipulated query data in my views, is it âproperâ of me to have my controller speak directly to the ORM and collect that? Or should I always request it through my model? Another quick point with regards to controllers, how do you guys deal with separating your controllers? Should I be building them per task? So one controller for my Shopping Cart, one for my Reporting and another for User Information and so forth? I know those probably seem like silly questions, Iâm just trying to understand what you guys regularly do, and what the âbest practicesâ are for working within an MVC design pattern. Thanks for any advice guys, Rob ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271841 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4