aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Khutornenko <ma...@apache.org>
Subject Re: Using immutables.org for Java code
Date Wed, 17 Dec 2014 23:26:57 GMT
Sure, that's a nice feature. Though its application would be limited
to unit tests as we almost never change mutable objects in prod code.

On Wed, Dec 17, 2014 at 1:03 PM, Kevin Sweeney <kevints@apache.org> wrote:
> One of the most exciting features of immutables.org collections (over our
> custom-generated ones) are the structural-sharing "wither" methods [1]. So
> instead of 2 deep copies in our version:
>
> ITaskConfig productionTaskConfig =
> ITaskConfig.build(taskConfig.newBuilder().setProduction(true));
>
> we do a single structural-sharing shallow-copy:
>
> ITaskConfig productionTaskConfig = taskConfig.withProduction(true);
>
> [1] http://immutables.github.io/immutable.html#toc15
>
> On Tue, Dec 16, 2014 at 10:34 AM, Kevin Sweeney <kevints@apache.org> wrote:
>>
>> I think adoption would be blocked on an upgrade to Guava 18.0, which we
>> should probably do anyway
>>
>> On Tue, Dec 16, 2014 at 10:31 AM, Zameer Manji <zmanji@twopensource.com>
>> wrote:
>>
>>> Nothing in particular stands out to me but I think it would be a nicer
>>> overall solution then our bespoke compiler.
>>> Perhaps if we ever feel the need to change the compiler we should first
>>> evaluate if we can move to a library like immutables.org.
>>>
>>> On Tue, Dec 16, 2014 at 9:44 AM, Maxim Khutornenko <maxim@apache.org>
>>> wrote:
>>> >
>>> > It looks quite interesting as a general case for immutability. As for
>>> > replacing our immutable thrift implementation, is there anything in
>>> > particular you noticed in immutables.org that we currently lack?
>>> >
>>>
>>>
>>> --
>>> Zameer Manji
>>>
>>
>>

Mime
View raw message