when a BO is added to another BO using 'Insert BO as:
Sinlge Object' from the Create BO dialogue, the
generated setter method signature contains no
parameters. the setter's body creates a default
instance of the child BO using the default constructor.
for example, adding an address object to to a customer
object causes this setter to be created
public Address setAddress() {
Address newAddress = new Address();
this.address = newAddress;
return newAddress;
}
to set the address you then would do something like this
customer.setAddress();
Address address = customer.getAddress();
address.setStreet("123 Something St.");
address.setCity("Columbus");
...
doing it this way first sets an invalid address that
has to be fixed-up later. the system could crash
before the address was completed, leaving a blank
address. why not a more normal setter like
public Address setAddress(Address newAddress) {
this.address = newAddress;
}
then using it would be
Address address = customer.getAddress;
address.setStreet("123 Something St.");
address.setCity("Columbus");
customer.setAddress(address);
...
this way only a completed Address gets set.
my question is why does the code generated create
setters without parameters? i'm not knocking your
approach rather i am curious why you chose this way. i
am considering contributing some enhancements to your
project in this area. i want to understand your
rationale first so that i can continue in the spirite
of the project and not go off on a tangent.
thanks and i really like what you have done so far.
very nice!!!
my customer class that i refer to in my question