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

Hari Shreedharan commented on FLUME-1780:
-----------------------------------------

Mike,

I am not commenting on the uselessness of factories or builders. I just don't 
see why we should use different methodologies for different components 
(sources/sinks/channels etc dont use it). 

Regarding your comments:
1. Any validation done within the configure() needs to be done in the builder - 
so there is no real benefit there. Maintaining lifecycle state is the only 
other validation that may be done - which is not strictly required, since our 
code is guaranteed to call configure only on a brand new instance - otherwise 
it is our bug.

2. Agreed, this is valid. But I don't believe this is a reason strong enough to 
warrant users to write builders for all custom classes (especially when the 
only way we force is using javadocs and instantiating that class directly). 
Also, I would assume that the JVM would be able to considerable optimization 
for variables that are never assigned to again.


Summary of what I think we should be doing: Don't force builders. Check if 
builder exists build it using that, else create using standard constructor and 
configure it. 
                
> Interceptors and serializers should not expect users to supply builders or 
> specify the builders in configuration
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1780
>                 URL: https://issues.apache.org/jira/browse/FLUME-1780
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Hari Shreedharan
>
> Forcing a programming model on users is not a good thing to do. We have 
> already specified the interfaces, that should be enough

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

Reply via email to