On 9/20/07, Vince Collins <[EMAIL PROTECTED]> wrote:
>
> Thanks Brian
>
> I failed to mention that these are my database cfcs which will often
> change so application scope isn't the best choice for me.


When you say they will "often change", what do you mean? You're changing the
SQL or column names?

Even though
> I'm not actually calling a database CRUD method yet, I wanted a handle
> on the objects to grab later down in the page build.  It's a small
> application but every page request will be returning dynamic data.


I just want to be sure you're not doing this unnecessarily. You can store
the CFC in the application scope and every call to it can return different
database results. In fact, this is how almost every database-related CFC
works.

Is there a lot more overhead instantiating an object versus say <cfparam
> name="blah" default=""> ?


Actually, because cfparam evaluates what you have in the default attribute
regardless of whether the value exists or not, cfparam would probably
perform much more badly. I think cfparam should really be avoided as much as
possible for this reason.

Brian Kotek wrote:
> > Well, you're creating the CFCs over and over on every single request,
> which
> > is probably not good. Depending on what the CFCs do, and whether they
> are
> > stateless (have no changing instance data) or stateful (holds changing
> > instance data, or holds different instance data for each user), most
> people
> > store stateless instances in the application scope so they are only
> created
> > once during the lifetime of the application. Stateful CFC are harder to
> > store in the application scope since concurrency must be dealt with, and
> > "per-request" CFCs (CFCs that are unique to each user or to each
> request)
> > can't be easily kept in the application scope, and must be created for
> each
> > request or possibly stored in the session scope.
> >
> >
> >
> >


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288931
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to