in the application scope"
Are you saying you keep data like, first name, last name, email (user info)
in the application scope?
You would have to have a unique struct name to reference them all by,
otherwise all user data would be overwritten each time, even so, the
application scope is not the ideal place to store that kind of data, the
application scope is more for application wide variables, like DSN, path
etc. The session/client scope is made to store user details...
I can;t think of any CFCs I would want to store in the Session scope either
(not yet anyway) - a CFC is an object you use in many places so therefore
the SERVER or APPLICATION scope would be the best there. If you use a CFC to
retrieve login details for example, why would you want to duplicate that CFC
many times across each session? that defeats the purpose of a CFC...
Taco Fleur
Blog <http://www.tacofleur.com/index/blog/>
http://www.tacofleur.com/index/blog/
Methodology http://www.tacofleur.com/index/methodology/
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 3 February 2004 2:44 PM
To: CF-Talk
Subject: RE: CFC or Struct in session
Since a CFC is a struct I doubt there's much different in performance. I
tend to place CFCs in the session (although technically I don't use the
session scope but keep all user data in the application scope) just because
it feels so good. Like walking barefoot through a tampon commercial-quality
meadow.
I can pass a "user" component around and pass it into other CFCs that accept
user components. You can do the same things with Structs tho.
CFCs do allow for stricter type checking however (something structs don't
have) and you get some nice initialization and compartmentalization aspects.
I can build a CFC that, just because it's that kind of CFC, knows that it
needs certain information and has defaults for it. It's not that you can't
do such a things with structs - CFCs just let you organize things better (I
think).
But as to whether it's more or less performant to use Structs or CFCs in the
Session scope I really doubt it matters. It might a little. but I'd be very
surprised to find out that there were any significant differences.
In the end I think it's more about personal preferences and architecture
than anything else.
Jim Davis
_____
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 10:15 PM
To: CF-Talk
Subject: CFC or Struct in session
I've been reading in a number of places where people place a reference to a
CFC in a users session variable. This has always seemed strange to me. Why
not cache the CFC for the application and only store the users data in a
session struct. Is there something I'm missing about saving an entire CFC
reference per user? Doesn't it have a higher overhead? Is there a
performance savings?
I'm going to bash on this tomorrow and find out myself, but if someone can
post their reasoning, I'd appreciate it.
Thanks
_____
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

