As part of my object oriented education, I was taught that the purpose of
the constructor is to initialize the object into an "valid state". So, for
example, take an object of type Person that has 3 instance variables:
Person
firstName
lastName
status
Of these three instance variables, 2 can be considered "required"
(firstName,lastName) and 1 will have a default value (status="active").
Thus, Person might have a 2-arg contructor like this:
public Person(String firstName,String lastName){
this.setFirstName(firstName);
this.setLastName(lastName);
this.setStatus("active");
}
My question is this:
1. Are people actually following this theory?
2. Doesn't the JavaBeans (non-ejb) requirement for a zero arg construcotr
kill this idea?
3. In EJB (where ejbCreate actually allows arguments) are people using this
startegy?
4. Say you have an ejb with 25 instance variables, 5 of which have
reasonable default values, would you create an ejbCreate method with 20
arguments?
Dave Ford
Smart Soft - The Java Training Company
http://www.SmartSoftTraining.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".