It's a one-time cost (per user), so I don't know that it's a big deal,
especially if your components are relatively lightweight.  If they're not
lightweight, you can make it faster by using the flyweight design pattern,
which basically abstracts functionality (but not state) out of an class that
there will be a LOT of instances of into a class with only a few (or one)
instances.  Then when you need that functionality you pass in the needed
state from one of your newly-lightweight objects.

For example, have a big-bulky CFC in your application scope that does all
the heavy lifting for your session CFCs.  Then in your session scope, you
have very lightweight CFCs that are no more than a set of variables and some
wrapper methods to call the methods of that application scope CFC, passing
in their own state to be used.  That way the state is bound to the session
(in the session CFC), but all the "largeness" is in the single
application-scope CFC, thereby making your session creation faster, and
reducing memory usage.

Cheers,
barneyb

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Chiverton
> Sent: Wednesday, February 18, 2004 1:30 AM
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] Dependancies
> 
> Has anyone done any work (or thought) about solving problems 
> with loading a 
> large number of co-dependant packages into the session scope ?
> For instance, session.user might use session.authFactory, so 
> you have to 
> create session.authFactory first.
> 
> My first thought was to have each CFC export a list of 
> requires and depends, 
> and have a 'loader' CFC that sorted it all out.
> That might be too slow, though I think, to do everytime 
> anyone logs on.
> 
> Thoughts ?
> -- 
> Tom Chiverton 
> Advanced ColdFusion Programmer
> 
> Tel: +44(0)1749 834997
> email: [EMAIL PROTECTED]
> BlueFinger Limited
> Underwood Business Park
> Wookey Hole Road, WELLS. BA5 1AF
> Tel: +44 (0)1749 834900
> Fax: +44 (0)1749 834901
> web: www.bluefinger.com
> Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
> Quay, BRISTOL. BS1 6EG.
> *** This E-mail contains confidential information for the addressee
> only. If you are not the intended recipient, please notify us
> immediately. You should not use, disclose, distribute or copy this
> communication if received in error. No binding contract will 
> result from
> this e-mail until such time as a written document is signed 
> on behalf of
> the company. BlueFinger Limited cannot accept responsibility for the
> completeness or accuracy of this message as it has been 
> transmitted over
> public networks.***
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[EMAIL PROTECTED]
> 

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to