posted 19 years ago
i do the following :
i request a bean throug a method of a session bean (suppose i need a Person with certain id). My session bean has a method :
public Person getPerson(int id) {..}
My business delegate on the client side receives this Person object (which is an Entity Bean (3.0)) so can edit the object with my GUI classes like a normal JavaBean. The best way to make a binding between the GUI classes and the domain object being edited is through events. So when a certain GUI widget (say a JTextField) changes a property of the bean (fe the name of the BirthDate), the bean needs to fire a PropertyChangeEvent so other classes may respond to this (fe by updating the Persons age).
So my setter method in the bean would look like this :
public void setBirthDate(Date date) {
Date oldDate = this.brithdate;
this.birthdate = date;
firePropertyChangeEvent("birthDate",oldDate,date);
}
Is this acceptable in an Entity Bean ?