Hugo, It just seems that in an MVC world, the Controller would want to perform a Server transfer rather than a CFLocation so that it would be directly deciding which view to return to the browser, rather than the indirect way of sending a path request that would then send an additional page request??
...................... Ben Nadel Web Developer Nylon Technology 6 West 14th Street New York, NY 10011 212.691.1134 212.691.3477 fax www.nylontechnology.com "Vote for Pedro" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hugo Ahlenius Sent: Thursday, December 08, 2005 7:31 AM To: [email protected] Subject: RE: [CFCDev] MVC exploration questions | I am slowly trying to learn MVC and better style OOP application | design. I just finished Head First Design Patterns which was an | excellent book. But, from what they seem to say, in the MVC | architecture, there is close to a | 1-to-1 ratio of views to controllers (though a single controller could | control various views). This seems to make sense since each page would | require different actions, validation, etc. I haven't read the said book, but I would suggest that you take a peek at one of the many MVC frameworks that exist for ColdFusion. I don't know about examples of 1-to-1 views/contollers (how would that look? what is the point?) but most cases for webapps implement one (or at least few) controllers. The Model (all your OO goodies) are separated from the views, and the controller is the thing that makes the different pieces an application. For Mach-II, for instance, this is primarily the flow that you specify in the xml configuration, where you direct how the logic should flow for a request. | So, from it sounds like, MVC style stuff never uses CFLocation since | all views are decided on the server then passed back to the response. | Is this way off base? Yes, you are way off base... :( cflocation (redirecting requests by a 302 header) are not related to MVC at all, and can be used in an MVC app just as much as in any other app. Since I know Mach-II, I would recommend that for an example of MVC + OOP in CFML. Peek at the example apps, and read the docs (primarily Sean Corfield's dev guide) and get your hands dirty and try to implement something reasonably simple (or refactor an existing app). /Hugo ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
