> 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 think it just a design decision. I find it easier (in the long term)
to encapsulate things into objects. It makes the program more logical. I
know CFCs are not quite objects, but they way I try to use them is
somewhat the same. It's easier, for me, to change / update / design an
application when I know everything I need is in the user "object" as
opposed to 38 variables scattered here and there for example.
As for performance, I see a lot of slightly humorous postings on the
list where people tend to optimize the heck out of something that in the
long term is gonna kill the maintainability of the program. For example
naming a variable "x" instead of "user_login_flag" will cause the byte
code to be smaller and probably execute faster - but is that the better
way to go?
> I'm going to bash on this tomorrow and find out myself, but
> if someone can post their reasoning, I'd appreciate it.
I think it's kind of a mute point. Your design should dictate the
storage of your application. Speed is not the only factor for a system -
while it is important - if you can save 10ms but it then takes 3 months
to figure out where everything is - did you save anything?
--
Vale,
Rob
Luxuria immodica insaniam creat.
Sanam formam viatae conservate!
http://www.rohanclan.com
http://treebeard.sourceforge.net
http://ashpool.sourceforge.net
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

