Vital stats:
Hibernate 2.1.2.
A parent class,
Foo, has a one to many relationship with child class,
Bar.
Which of this design is better and why ?
#1) The client program performs the association task.
e.g. In the web tier
Code:
Foo f = new Foo();
Bar b1 = new Bar();
Bar b2 = new Bar();
f.addBar( b1 ); f.addBar( b2 );
delegate.createFoo( f );
#2) the SLSB (session bean) performs the association
Code:
Foo f = new Foo();
Bar b1 = new Bar();
Bar b2 = new Bar();
delegate.createFoo( f );
delegate.addBarToFoo( f, b1 );
delegate.addBarToFoo( f, b2 );
Thanks a million.
Regards,
Alistair