On Fri, Mar 28, 2008 at 1:04 PM, Brian Eaton <[EMAIL PROTECTED]> wrote:

> There are a couple of patterns I could use to give OAuthFetcher a
> reference to a persistent data store.  They all seem to work equally
> well.  Let me know if you've got a preference.
>
> Option 1: CrossServletState (superseded by Guice real soon now...)
> - CrossServletState gets a reference to a single GadgetTokenStore object
> - CrossServletState provides a factory method to create OAuthFetcher
> objects, passing in the GadgetTokenStore
> - subclasses of CrossServletState implement their own factory methods
> that pass in the token store.
>
> Option 2: OAuthFetcher subclasses provide persistence
> - OAuthFetcher gets a protected method getGadgetTokenStore that
> returns a reference to a single GadgetTokenStore object
> - subclasses of OAuthFetcher return their own GadgetTokenStore
> implementatino instead.
>
> Cheers,
> Brian
>

The right model is probably to have guice create the persistence store and
have that injected into whatever creates the OAuthFetcher (either the
ProxyHandler itself, or some new factory). That's what I've done with all
the other things that were formerly a part of CrossServletState.


-- 
~Kevin

Reply via email to