> the application scope?
>
> If so, do you then lock each call to the shared CFC method?
Yeah, or perhaps a CFC created on the fly (which obviously isn't
really shared). The point is that the CFC instance isn't tied to the
session in any way.
You don't have to lock the calls to the shared CFC, because the CFC
doesn't have any instance data. The "instance data" is passed in to
each method call. You will have to lock any place you'd have to lock
using a session-scoped CFC (to deal with race conditions between
multiple requests to the same session, such as often happens when
loading framesets), but no special locking for using this method.
http://www.dofactory.com/Patterns/PatternFlyweight.aspx
There's a link to how the Flyweight Pattern works. I'm applying it in
a slightly different way, and for very different reasons, but the
general concept of passing state into the method of a shared instance
is the same. The shared instance part isn't necessary, as I said
above, the important thing is that the instance has no ongoing
relationship to the instance data.
cheers,
barneyb
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

