You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Stephan Klevenz (JIRA)" <ji...@apache.org> on 2010/10/06 19:54:31 UTC

[jira] Commented: (CMIS-242) API improvement for methods having long parameter list

    [ https://issues.apache.org/jira/browse/CMIS-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918612#action_12918612 ] 

Stephan Klevenz commented on CMIS-242:
--------------------------------------

I'm fine with this.

+1

> API improvement for methods having long parameter list
> ------------------------------------------------------
>
>                 Key: CMIS-242
>                 URL: https://issues.apache.org/jira/browse/CMIS-242
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: opencmis-client
>            Reporter: Stephan Klevenz
>            Assignee: Stephan Klevenz
>             Fix For: 0.2.0-incubating
>
>
> The parameter list of methods like
>     Document createDocument(Map<String, ?> properties, ContentStream contentStream, VersioningState versioningState,
>             List<Policy> policies, List<Ace> addAces, List<Ace> removeAces, OperationContext context);
> is very long and often many of the parameters will be set simply to null. API usability and code readability is not nice.
> I suggest to overload method for the 80% use case having a shorter parameter list. In this example it could be
>     Document createDocument(Map<String, ?> properties, ContentStream contentStream);
> Rule of thumb could be to have at least one overloaded method where all parameters related to optional features are removed.
> WDYT

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