Is language support for collections is a coin feature ?
Reinier Zwitserloot
reinier at zwitserloot.com
Tue Sep 28 14:55:25 PDT 2010
Because arrays are obsolete. Also, in the example I showed, you're actually
giving an AddressBuilder to .add(), not an Address. With methods, you could
accept either. This trick doesn't work so well with arrays. Same story if
generics are involved.
--Reinier Zwitserloot
On Sun, Sep 26, 2010 at 2:39 PM, Ulf Zibis <Ulf.Zibis at gmx.de> wrote:
> Am 26.09.2010 05:51, schrieb Reinier Zwitserloot:
>
> Advocate of the devil mode:
>>
>> User user = new User()
>> .firstName("Remi")
>> .lastName("Forax")
>> .addAddress().zipCode("30785").done()
>> .address(new Address().zipCode("30785"));
>>
>
> See also:
> http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/001180.html
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6479372
>
>
> User user = new UserBuilder() {{
>> firstName = "Remi";
>> lastName = "Forax";
>> addresses.add(
>> new AddressBuilder() {{
>> zipCode = "30785";
>> }},
>> new AddressBuilder() {{
>> zipCode = "67899";
>> }});
>> }}.build();
>>
>>
> Why not? :
>
>
> User user = new UserBuilder() {{
> firstName = "Remi";
> lastName = "Forax";
> addresses = new Address[] {
>
> new AddressBuilder() {{
> zipCode = "30785";
> }},
> new AddressBuilder() {{
> zipCode = "67899";
> }}
> };
> }}.build();
>
>
> -Ulf
>
>
More information about the coin-dev
mailing list