@Jared: thanks for the tips. I am on CF7. I'm not too keen on the idea of introducing FB (one immediate concern is that there would be so many URL to re-write [which I know could be handled in CF or via something like Isapi ReWrite but this introduces another job]). My main reason for migrating to OOP are the obvious reusability and scalability. Currently the app has a lot of duplicate queries, procedures so when you change something in one area if you don't know the app the other area will remain unchanged and wrong. I feel that once an OOP MODEL layer is in place (with a simple listener layer talking to the model layer) it will be much easier one day to introduce a framework.
Anyone else got 2 cents to throw in? Cheers Matthew On Feb 4, 3:55 pm, Jared Rypka-Hauer <[email protected]> wrote: > Matthew, > > I'm only guessing here, but it doesn't sound like you have ColdFusion > 8 running on your server. If that's incorrect, well, the answers get > even easier! :) > > If I were you I'd create a separate development environment, move the > site into Fusebox, deploy the frameworked version (with either an > ISAPI URL rewriter or onRequestStart(), onRequest() and > onMissingTemplate()), and then start messing with the model. OOP isn't > as important as encapsulation and cohesion which can be done even with > an essentially procedural framework like Fusebox. > > Moving a procedural app to Fusebox isn't all that hard, really (you're > just chopping your cfm files into smaller chunks and wiring them > together with the config file), and it's a lot easier and faster than > moving from procedural to OO. If you want OO, do it only after you've > gotten the rest of the site under control, otherwise you're really > only making a big problem into a huge problem. > > Your best friends in this case will be: > > Application.cfc for the sake of: > > onApplicationStart() to load up the application scope (which you're > already doing but onApplicationStart() is so tidy) > > onRequestStart() and onMissingTemplate() to route requests for the old > filenames to Fusebox fuseactions... also could be a great place to use > mod_rewrite or the IIS equivalent > > onSessionStart() for doing <cfset session.cart = > createObject(...).init() /> > > onSessionEnd() for saving unfinished cart info to a DB for later (what > you might call a "value added feature" because it's fairly simple and > bring a lotta bang) > > Many huge performance and code updates. > > So, to recap: > a) switch the application over to Application.cfc. You _are_ running > at least ColdFusion 7, right? > a.1) Upgrade the site to CF 8 > > b) use onSessionStart() in Application.cfc, create a cart object in > the session using createObject(). > b.1) If CF8 is not available and is out of the question, change jobs. > Err, I mean do > > <cfif not structKeyExists(session,"cart")> > <cflock scope="session" type="exclusive" timeout="10> > <cfif not structKeyExists(session,"cart")> > <cfset session.cart = createObject(...).init() /> > </cfif> > </cflock> > </cfif> > > c) Move the site to fusebox to get the architecture under control and > THEN start messing with the implementation. > > Just my advice, YMMV. :) > > J > > On Feb 3, 2009, at 10:37 PM, Matthew wrote: > > > > > Hi guys > > > I'm retro fitting a spaghetti code application to OOP. I'm doing it a > > piece at a time (as I work on a section of the website I take some > > extra time to migrate it to OOP). Because I'm slowly doing it I can't > > use a framework until everything has been migrated (also because I > > don't want to de-stablise the app too much). ... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
