Aaron, Can offer this suggestion to you - you seem to be where I was not too long ago ... persevering with it is WELL worth the effort.
When I started tinkering about with CFCs, I used them as a collection of functions. A bit like I had been including a cfm file containing a library of common functions for some time already. The CFC approach seemed to be pretty easy and basically the same thing, and I couldn't really see the big benefit of it. It just seemed to be another way to do the same thing I'd been doing for years. Big deal. Then I started playing with Mach-ii, and I jumped in too far, too deep and it was beyond me. I retreated for a while and just continued using CFCs as libraries of functions. I came back to it every so often, because it was such a major and frequent topic on lists like this I figured there had to be far more to it than I realised. Gradually the light went on.and it all started to make some sense to me. For someone who has learned everything 'on the job' and who has no formal training in IT, that's kind of how I've learned almost everything I know. Anyway, here's where I am now, and what I think has been the return for me .....(sorry if this is stating the obvious to those who already 'get' OOP) In January, I built a Content Management System entirely using the OOP techniques I have learned so far. No doubt people more experienced than I or with more formal study on OOP could pick holes in what I've done, but look at what the effort's done for me: - I built the whole CMS from scratch in two weeks. Maybe it's not as complex as farcry perhaps but it's delighted at least one client so far and I know for sure it's far easier for novices to use. I was able to build a couple of code generators to automatically take care of a lot of the tedious typing too. - Using OOP concepts, I have built it so that logic and business are fully separated from display elements and also from the content. Now I have an easily portable core I can use and reuse. I've rebuilt my own site (not yet deployed) in half a day, including plenty of customising. I expect to rebuilt 3 probono sites over the weekend and still have time for some woodwork and a beer or two. - Using this method forced me to think about the project differently. The whole project became far clearer in my mind, and building it was much easier. Instead of dealing with a large complex project, i was dealing with a whole lot of little tiny bits. Create an object, populate it with data, pass it to a CFC to do something with it, pass it back. It's kinda fun to see these bundles of data flying about my sites. - Each element is self-contained and if you get it right, ensure errors are trapped and dealt with, it's very robust. Build 50 small elements all of whom are extremely robust and independent of the others, and your whole system is far more robust than I'd been used to previously. It's just neat to know that when I call the create() method, it's going to bloody well WORK, because I already made sure the create() method works when I wrote the DAO cfc. Almost completely gone is the error that drove me CRAZY in earlier days - "the <variable name> is undefined". I hated that. Now variables almost always have a value, and all I have to do is make sure it's the correct value. - Maintenance far easier and quicker. In the past, to add a field to a table, meant changing the table, changing the SQLstatements there, and there, and there, changing the form there, and there, and there, and that action page, also that one and that one, and inevitably I'd miss a change somewhere. Testing was a tedious process. Now, using OOP I have only one file where SQLstatements are, one form, one bean, maybe a couple of places where the data is manipulated. Adding a column is a piece of cake, and I can easily identify where the changes will have to be. - When I think of a new idea, or the client wants something changed, it doesn't worry me as much as it used to. In the past, I'd catch myself thinkiing "oh no I dont want to go into that stuff again . I'm going to have to change that and that and that and the other thing, and test all that stuff all over again ... " And I'd find when I started work that there were far more strings of spaghetti crossing that area than I thought. Now, a change is nowhere near as difficult. And changes in one area are far less likely to impact on other areas. With every aspect of my CMS encapsulated in a little single-function bubble of its own, blind to everything going on around it except what it needs to know, I can make changes, knowing in advance exactly what files are going to be affected and where changes are going to be needed. - Aaron this doesnt answer your specific question I know, but I just wanted to tell you that it can be confusing, seems at times like it's a lot of typing to do something pretty simple, but it's worth the effort. I remember sitting back thinking, just like that Honda tv ad ... "isnt it great when things just WORK" first time!! Cheers Mike Kear Windsor, NSW, Australia Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com On 2/17/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > Thank you James, > > I think I might climb out of this one. Things are still a bit ethereal > in my mind but I think I am begining to grasp it much more now. I > would like to see a mock-up of the code inside the component using > srategy number 2. Perhaps some comments explaining the relationship > between the data in the psuedo-constructor with the set method and the > relationship between the set method and the insert method would help. > Of coarse, I can't expect anything since you have been entirely too > kind already to help me out thus far ;) > > -Aaron > > P.S. I have been studying up on CFC's and trying to write code for > about two-three weeks now and all I have is four, half-written > components. I don't think I would ever get this if I wasn't working on > it from 8-5 Monday thru Thursday and if I didn't have resources such > as this list, multiple tutorials, books, and a subscription to vtc.com > and communitymx.com. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232675 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

