users@jaxb.java.net

Re: unable to use the jaxb2-basics plugin

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Fri, 26 Aug 2011 17:56:19 +0200

Hi,

> One thing I'm wondering is just what is the POINT of all the strategy and
> complex code usage?

I would disagree that it's complex.

> Rather than just generating a simple block of code for equals, it generates
> something that requires use of external code methods- which means I now have
> to track versions of Yet Another library, AND it makes debuging/tracing
> through the code that much more difficult.

Reasons:

* Not to repeat hashCode/toString/equals code over and over again.
It's the same code everywhere, but it's not trivial. Options are:
generate it duplicated everywhere or use utility classes. I opted for
the second option, I really prefer binding a library instead of
duplicating exactly the same code several hundres or thousands of
times. Utility classes were implemented as strategies.

* Strategies alllow you not only to check if value equal and so on,
but also do advanced tricks like to log where exactly is it different.
This is extremely useful.

Bye,
/lexi