I'm probably missing something (I often do!), but just brainstorming here
are some thoughts.

Would it be a bad thing to have a Manager of managers?  I would see such a
thing as a collection of CFC references (each reference being a manager).
You might then say something like:

Managers.get("myCFC").getReference()

In other words see if "Managers" has a manager reference for myCFC (building
one if needed) and then grab me an object reference from it.

That collection could also be a cache in that each reference could have a
"lastAccessDate" property.  You can then have an external task run through
it periodically to destroy references that have been used in a while.

I use this kind of caching in the security system I posted a few weeks ago.
At least in that instance the task poses no performance issues (that I can
see) to the application and neatly manages instance bloat.

To understand the CFC references your application is sending your Managers
cfc could use several methods, from the nearly purely automated to manual.  

If your managers are all of a kind you might be able to create a generic
manager that accepts the cfc name to manage as a parameter.  This way your
Managers component would also be a type of manager factory.

If they are more complex you could create a naming convention to call them
easily.  If Managers were passed "myCompany.library.myCFC" as input it might
look for a Manager component called "myCompany.library.myCFC_Manager" and
use that.

You could also place information about the managers for a CFC in the CFC's
metadata.  This is slower (since behind the scenes the CFC will be
instantiated to obtain its metadata) but could be cached making that a
one-time hit.

In short the whole point is to create a single point of access.  In the end
I think that you'll have as many CFC instances as you do access points (I
don't see any way around that) so condensing the access points in some way
seems the way to go to me.

You might also be able to trick things a little by replacing your CFCs with
functions.  For example if all your Manager's are doing is looking in a
persistent storage location and returning what they find why make them CFCs
at all?  It would seem that a single persistent function library would be
able to do the same task without the overhead (and the syntax would be
essentially the same I think).

I don't know Mach II so this may not be an option, but it would seem that
Mach II should allow you to load a function library and use it.

Jim Davis



----------------------------------------------------------
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