[ 
http://opencast.jira.com/browse/MH-6375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=23664#action_23664
 ] 

Kenneth Lui commented on MH-6375:
---------------------------------

Here is a summary of how Sakai Nakamura performs servlet documentation. I have 
attached their relevant source files. Please note that ServiceDocumentation, 
ServletDocumentation, DocumentationServlet are similarly named but very 
different.

First, for each servlet class, it is annotated by a root element called 
"ServiceDocumentation". It contains sub-elements such as name, description, 
short description, bindings, url, methods (e.g. GET & parameters) etc. In some 
sense this is similar to our DocRestData class but Sakai uses annotation 
instead. All relevant classes (e.g. ServiceBinding, ServiceMethod etc.) are in 
the doc folder of my attached files.

Second, they are ServletDocumentationRegistryImpl and 
ServletDocumentationRegistry classes which keep track of the servlet in Sakai. 
Whenever it binds a servlet, it creates "ServletDocumentation" object for that 
servlet. The constructor of "ServletDocumentation" gets the annotation 
class("ServiceDocumentation") from the servlet class and keeps it as an 
instance variable.

Third, when a user retrieves documentation, he goes to "DocumentationServlet". 
This class is itself a servlet. From the request parameter, it figures out 
which service's documentation is needed and then asks 
"ServletDocumentationRegistry" for the corresponding "ServletDocumentation" 
object. It then delegates the HTML constructing work to this 
"ServletDocumentation" object which constructs the HTML by the information 
stored in "ServiceDocumentation" (i.e. the annotation).

Other than the use of annotation, I think the main difference between our 
approach and their approach is that they are more "centralized". All 
documentation queries go to "DocumentationServlet", and all available 
documentation is stored in the registry. In our case, every servlet is 
responsible for serving its own documentation.

I suggest that we can keep our "decentralized" approach at this moment and use 
annotation class to replace "DocRestData". If it satisfies our needs, then we 
can think about whether we want to adopt their "centralized" approach.

> Update rest documentation method to be similar to the one in Sakai
> ------------------------------------------------------------------
>
>                 Key: MH-6375
>                 URL: http://opencast.jira.com/browse/MH-6375
>             Project: Matterhorn Project
>          Issue Type: Task
>          Components: Architecture & Services
>    Affects Versions: 1.2
>            Reporter: Christopher Brooks
>            Assignee: Kenneth Lui
>             Fix For: 1.2
>
>         Attachments: SakaiDocumentationCode.zip
>
>
> The Sakai project uses a system similar to ours for building their rest 
> endpoint docs, but they use attributes instead of code.  This has some huge 
> readability benefits.  Check out how they do it and provide an example with 
> this ticket, including an example of how we do it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://opencast.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________

Reply via email to