hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron T. Myers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-8736) Create a Builder to make an RPC server
Date Wed, 29 Aug 2012 18:18:08 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-8736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444287#comment-13444287
] 

Aaron T. Myers commented on HADOOP-8736:
----------------------------------------

bq. Firstly, the "truly required fields" are just the truly required for now, and it's hard
to predict future.

Sure, but if/when that future comes, what will have to happen with each of these approaches?
In the constructor approach, you'll change the constructor signature and then things won't
compile until you've fixed all of the call sites. That is good. In the multi-method builder
approach, everything will compile, but you'll have to run all of the tests to find the call
sites that you missed when adding a new builder method call, and also will have to hope that
the tests in fact do cover all of the call sites. That is bad.

bq. Secondly, even we have a constructor with all the current required fields, the developer
can still pass null pointers by mistake.

Of course that's always a possibility, but that seems less likely than a developer forgetting
to call a builder method that is in fact required. That's also a possibility with the multi-method
builder approach as well - the developer might pass null values by mistake.

But like I said, you can go with whatever you prefer. You haven't convinced me that this is
the right way to go, but I'm not going to stop you from doing it.
                
> Create a Builder to make an RPC server
> --------------------------------------
>
>                 Key: HADOOP-8736
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8736
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: ipc
>    Affects Versions: 3.0.0
>            Reporter: Brandon Li
>            Assignee: Brandon Li
>         Attachments: HADOOP-8736.patch, HADOOP-8736.patch, HADOOP-8736.patch
>
>
> There are quite a few variants of getServer() method to create an RPC server. Create
a builder class to abstract the building steps and avoid more getServer() variants in the
future.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message