On 11/2/05, Gareth Cole <[EMAIL PROTECTED]> wrote:
> I've set the Authenticator to receive an instance of UserGateway in the
> init() method, but have a slight problem with the type attribute.
...
> But now I have application specific dependency again by having to use
> 'com.myApp.user.UserGateway', as 'myApp' will change for every new site.

This is a situation where factories and IoC helps. You could pass a
factory into the authenticator (the factory is generic and would not
change between apps so its type is fixed). The authenticator asks the
factory for the user gateway without needing to know its type. The
factory config deals with the exact type of the gateway (so its XML
file differs in each app).

Alternately, if we had some sort of interface in CFML, you could
specify a fixed interface type and have your various gateways
implement that (com.myApp.user.userGateway implements
genericUserGateway).

Or you can just use type="any" or type="WEB-INF.cftags.component"
instead of the specific gateway type.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

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


Reply via email to