You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "carryxyh (GitHub)" <gi...@apache.org> on 2019/03/10 05:11:00 UTC

[GitHub] [incubator-dubbo] carryxyh commented on issue #3549: Fluent style builder API support(#3431)

I don't think we need so many builders like `AbstractInterfaceBuilder`. It seems that this class only provides some public properties. And users don't need to use these builders at all, even inside dubbo.

I think we can use the builder to inherit existing classes to do the reuse of using public properties, instead of turning all Config into builders.

IMO, fluent api is just for users, we can make code like this:

```
AbstractReferenceConfig {
	
    protected Boolean check = true;

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public Boolean isCheck() {
    	return this.check;
    }
}

ReferenceBuilder extends AbstractReferenceConfig {
	
    public ReferenceBuilder setCheck(Boolean check) {
        super.setCheck(check);
        return this;
    }

    public ReferenceConfig build() {
    	ReferenceConfig r = new ReferenceConfig();
    	r.setCheck(check);
    	return r;
    }
}
```

What do you think?

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3549 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org