You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by bdelacretaz <gi...@git.apache.org> on 2017/09/27 07:50:42 UTC

[GitHub] aries-containers pull request #1: Suggesting a different way of writing the ...

GitHub user bdelacretaz opened a pull request:

    https://github.com/apache/aries-containers/pull/1

    Suggesting a different way of writing the Builder

    Here's a suggestion for a different way of writing Builders, which avoids duplicating member variables. The downside is that those can't be made final anymore, but as the class doesn't have setters I don't think that's a problem.
    
    As mentioned this is just a suggestion, feel free to ignore! I was just curious how this would work and maybe this is useful, but if not it's no big deal.
    
    All tests pass but the `makeUnmodifiable` method's lockdown of collections is not currently covered by tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bdelacretaz/aries-containers builder-suggestion

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/aries-containers/pull/1.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1
    
----
commit 4d335dfafaa4b7ffb6c868aef2a2e0f7b6f97883
Author: Bertrand Delacretaz <bd...@apache.org>
Date:   2017-09-27T07:46:28Z

    A different way of writing the Builder, which avoids duplicating the member variables

----


---

[GitHub] aries-containers issue #1: Suggesting a different way of writing the Builder

Posted by bosschaert <gi...@git.apache.org>.
Github user bosschaert commented on the issue:

    https://github.com/apache/aries-containers/pull/1
  
    Hi @bdelacretaz thanks for the contribution! Having all member variables as final (as it was before) is kind of nice because you know that at least for the scalars they will be immutable. OTOH with your approach the members are private and there are no setters, so they are effectively immutable (combined with the collection lockdowns). I agree that your approach is nice in that it avoids the duplication of variables in the builder.
    
    I'd be more than happy to take this in.


---

[GitHub] aries-containers pull request #1: Suggesting a different way of writing the ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/aries-containers/pull/1


---