tradem wrote:
Do you really thing that cyclic references are a good desing technique?
Yes, I'm positive.
As I told you, I think this is a design error to have such circular deps between components, and having constructor deps design seems better than bean deps design (Pico container tries to demonstrate that). But we're talking about object level design : this is called bidirectional relationship.
tradem wrote:
In fact the strategy avoids to run into the problems with nullable datbase fields and safes us form adding hundrets of if != null assertions before persisting to database.
Hum, what is the difference between that
Code:
if (myString1 != null) {
myObj1.setString1(myString1);
}
and
Code:
if (myString1 != null) {
myObj1 = new MyObj1(myString1);
}
Same number of if != null.
BTW, You can set to a private level your POJO setters, Hibernate can deal with that. Thus, common users must use your parameterized constructor.