[ 
https://issues.apache.org/jira/browse/SHINDIG-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637098#action_12637098
 ] 

Evan Gilbert commented on SHINDIG-641:
--------------------------------------

Few notes on the patch:
- Since this patch changes the API for adding additional handlers, would be 
good to have a brief set of instructions of "what to do after you sync" to fix 
issues.
- Think that with a few small changes, clients could create an instance of 
DefaultHandlerDispatcher instead of subclassing to configure Shindig. Possible 
path to this:
  1. Rename DefaultHandlerDispatcher to StandardHandlerDispatcher or similar
  2. Have a constructor that takes a Map<String, Provider<? extends 
DataRequestHandler>>, and move the default constructor to a helper static that 
gets the default provider.s
  3. (optional) Have functions to addDispatcher(String, Provider<? extends 
DataRequestHandler>) and addDispatcher(String, Class<? extends 
DataRequestHandler>) to allow for distributed initialization.
  4. Profit.
- Moving the provider of SampleContainerHandler from 
org.apache.opensocial.social.sample.service -> SocialApiGuiceModule creates 
dependency from from our core package on the sample package. We should probably 
not have this dependency.
- I like the simplicity of HandlerDispatcher.getHandler() returning an actual 
handler instance. I can also see use cases where it might be useful to have it 
return a provider - this would allow the client code to choose when to get an 
instance. For example, if we decided for non-batch cases to create one servlet 
per handler at initialization time instead of having a dispatcher servlet 
(slightly contrived case), we could have each servlet be passed in a Provider. 
No need to change this unless you think it's a good idea - we can always add 
later.


> Simplify DataRequestHandler dispatching
> ---------------------------------------
>
>                 Key: SHINDIG-641
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-641
>             Project: Shindig
>          Issue Type: Improvement
>          Components: RESTful API (Java)
>            Reporter: Adam Winer
>            Priority: Minor
>         Attachments: shindig-641.patch
>
>
> SHINDIG-638 cleaned up DataRequestHandler creation, but still left us with a 
> HandleProvider API that you need to subclass to manipulate, and that also 
> codifies a service-name-to-handler Map as the dispatching mechanism.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to