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]

Reply via email to