Sorry, I'm not sure I understand the point about Lombok here.  Strong
typing here refers to the fact that we're able to use structured types
using nested tuples (yes, we could implement a discreet selection of
additional sizes of tuples, just like Scala does) in place of
collections.

As to using Lombok -- I have nothing against it on principle.  This is
essentially another solution to the same problem.  Lombok solves the
problem of boilerplate and bugs by automating code generation at
compile time.  Using a tuple structure as a superclass for your
desired immutable data structure achieves the same thing -- the user
does not need to worry about correct implementations of those
methods.  The difference here is that the entirety of runtime behavior
is completely expressed in the source code within Java 5 spec.

Does this answer your question?

On Feb 16, 5:06 am, Fabrizio Giudici <[email protected]>
wrote:
> On 02/16/2011 08:06 AM, Miroslav Pokorny wrote:> Why would anyone want Person 
> to be a Pair<F,Pair<B,Z>> ?
>
> I have got some questions and curiosity about this approach, but not
> that specific question. I understand that making a Person a Pair<...> is
> just an implementation detail (ok, this brings to the discussion about
> using the inheritance for implementing something, and it's one of my
> questions), so we shouldn't read it "Person is a kind of Pair". To solve
> the problem at code level, one could imagine some compiler trick for
> generate code implemented in Lombok. Of course, if you're doing
> something hidden behind the compiler, one might question whether there
> are better implementations than Pair<...>
>
> So, my first question is: what's the target which we're aiming at? From
> the original post I only read: good hashcode/equals, immutability. Are
> there other things? If one resorts to Lombok, it could have Guavac to
> take care of them in other ways.
>
> So, I'd exclude that a Lombokized approach to the thing is a valued
> option for Pair<...>. At this point, I don't exactly understand "strong
> typing": of course, strong typing when using Person is given by the fact
> that Person declares Strings and ints. The strong typing coming from
> Pair<...> seems only related to the implementation.
>
> --
> Fabrizio Giudici - Java Architect, Project Manager
> Tidalwave s.a.s. - "We make Java work. Everywhere."
> java.net/blog/fabriziogiudici -www.tidalwave.it/people
> [email protected]

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to