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

David Primmer commented on SHINDIG-268:
---------------------------------------

Cassie,

regarding descriptions:
you said "the code is using the description field (provided from abdera) to 
convert the description text into enums. before, the descriptions were hand 
typed as a lowercase space separated version of the enum.toString. this seemed 
super super sketchy so that's why i made it automated."

I think I understand you here. You're saying that when the routename is 
provided by abdera, it was translated by this hand-typed connection. However 
that routename is set when the route is added with the result of the 
.toString() method. This closes the loop and makes it a fine string reference 
that cannot go wrong unless the value is changed midway through the request. I 
don't think it is going to happen. In other words, it doesn't come from abdera, 
it comes from the enum.

The point I was trying to make is that there are two issues with the 
description field-

1 a round-trip identifier for the route that can be passed into addRoute and 
out of getRoute. So far, the only candidates are route name and pattern. I 
chose route name but they're both considered immutable once the routes are 
initialized. I was using the contents of the description field in the enum for 
this purpose.

2 a way for implementers of shindig to control the display of the 
human-readable titles of their collections and make those titles localized. I 
was pointing to this with the description field and suggesting that it could 
also be a resource package. In any case, I suppose the 'getDescription()' 
interface should be maintained on the enum and the internal structure could 
change. I just thought the shortcut you took of pulling the description field 
out and changing the constructor made it harder to see the way forward since 
the enum didn't have a description field. 

I've since realized that having decent descriptions for the collections would 
involve using info from the token and some sort of templating system to get 
"Friends of Cassie in the group 'dancers'", so I'm less attached to the plain 
generic strings we're providing. 

btw, jira is super flaky all day. work on this issue may be delayed.

> Refactor Route managment in the provider
> ----------------------------------------
>
>                 Key: SHINDIG-268
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-268
>             Project: Shindig
>          Issue Type: Improvement
>          Components: RESTful API (Java)
>            Reporter: David Primmer
>         Attachments: exampleUsage.txt, 
> shindig-268_refactor_route_managment.patch, useGuiceForRoutes.patch
>
>


-- 
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