Hello,

I think that's the good way.
IAuthentificationDelegate is your abstract strategy. (cf : strategy 
pattern).
If you need it (just if you need it, over-engineering sux ^^), you coud use 
abstract factory pattern to retrieve each set of concrete strategies (to 
manage all the logic of your application) provided by a concrete factory 
(webfactory, remotingfactory and localfactory) depending on the context.

francis

----- Original Message ----- 
From: "Christophe Herreman" <[EMAIL PROTECTED]>
To: "Open Source Flash Mailing List" <[email protected]>
Sent: Wednesday, September 13, 2006 12:01 PM
Subject: [osflash] ARP/Cairngorm: Using multiple data sources


> Hi guys,
>
> Note: I originally posted this to the flexcoders list, but thought I'd try 
> it again here. So sorry if you read this twice.
>
> We are developing an application that has login functionality.
> Depending on the "context" (offline, online, ...) the application runs
> in, we would like to switch between local file io and online database
> access via remoting or webservices to read and write the user data.
>
> I was thinking where the best place would be to put the switch mechanism.
>
> My thought: We would have a LoginCommand that calls a business
> delegate (let's call it AuthenticationDelegate) to talk to the remote
> services, web services or the local file system. The command doesn"t
> create a specific business delegate but gets it from a configured
> locater or even a factory that tries to look up the context. The
> command receives a IAuthenticationDelegate instance which would be a
> specific implementation of WebserviceAuthenticationDelegate,
> RemotingAuthenticationDelegate or LocalAuthenticationDelegate.
>
> Does this seem like a good solution to you guys, would you place the
> switch elsewhere or is the idea bad altogether? I'm pretty sure it should 
> work, but I was wondering if any of you had done something similar before.
>
> thx for your time,
> Christophe
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
> 



_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to