On Friday, February 22, 2013 11:13:44 AM UTC-6, John Moss wrote: > So I have been goofing around with creating some objects and I have a > couple of questions... > > 1. I created a user object so that I can say <cfset user = new user()> > (Which rocks, by the way.) Where can I put user.cfc so that I can create > the user object on any line in my project? >
openBD uses dot paths for locating cfcs. So I think if your .cfc file is in /foo/bar, you would do: <cfset user = new foo.bar.user() /> But I have not actually tried using the new syntax that allows using new object() like this... I am assuming that is how you would do it since that is how you do it for cfobject calls. You can also create a mapping in the admin console for your cfcs (which is what I usually do). You could for example name the mapping "cfcs", and put each of your cfc files in the mapped folder. It doesn't matter what the path is - you will use the mapping name to get to them. If you did that, your paths would be like this: <cfset user = new cfcs.user() /> > 2. Seems like I have read a couple of times people saying discouraging > things about objects--that object-oriented coldfusion doesn't perform well. > Is there really a performance hit? > I would ignore such arguments. If you prefer OO style programming than use it. There are valid arguments for and against it, but ultimately what matters is what you feel comfortable with. There is some overhead involved with objects in CF, but frankly I have never seen enough difference to worry about it. There are advantages too, you can load your instances in a shared scope and keep them in memory for example. Again, do what you feel comfortable with. > > I am coming back to a large project which started in 2002 and was worked > on by a dozen or so developers all with different levels of coldfusion > experience (most of them had none) and the biggest problem it seems is not > the performance of coldfusion itself, but the unorganized code (spagetti > code.) > > Thanks for all you guys do! > > -Moss > > -- -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en --- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
