I like the ProductWebServiceFactory approach. How are you thinking of doing
the caching? CF9's cfcache? Model-Glue's cache? ColdBox's cache? Isaac's
CacheBox? Roll-your-own? Remember that cache invalidation is one of the two
hard things <http://martinfowler.com/bliki/TwoHardThings.html> in Computer
Science.

Does the ProductManager object need to be created on every request? Can you
put it in the session scope on login? That would trade off the per-request
time overhead for a little session memory overhead.

-- Dennis

On Thu, Apr 15, 2010 at 7:32 AM, Chris Blackwell <[email protected]> wrote:

> Hey all,
>
> I have a MG application in development and i'm considering a bit of a
> refactor. Here's the core components
>
> *ProductWebService a wrapper class for the webservice, gets passed a
> username & password in init() and then performs a login() call to the
> webservice to retrieve a cookie used to authenticate subsequent calls.  *
>
> *ProductManager gets an instance of ProductWebService, Handles all the
> business logic involved with using the web service*
>
> *ModelGlue Controllers get passed ProductManager into their beans scope*
>
> So the application was originally spec'd to have an installation per
> client, but we're thinking about changing to have one installation, then use
> MG's dynamic view mappings to customize the UI for each client.  What i'm
> wondering is how to refactor  things to allow the ProductWebService &
> ProductManager to allow different username/password for each customer.
>
> I can't treat ProductWebService as a transient because the login() call
> that's required when its created is a big overhead. So i'm thinking about
> creating a ProductWebServiceFactory to create and cache instances of the
> ProductWebService, then making the ProductManager a per-request object
> created in onRequestStart and injected with the
> appropriate ProductWebService for the current request and placed in the
> event.
>
> If anyone has any thoughts on this approach, or have any suggestions on how
> it might be improved, would be muchly appreciated.
>
> Cheers, Chris
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to