> Hi!
> I've been writing a program that operates on small hand-made database.
> And I would like other objects to track changes in this database
> possibly in the swing way i.e:
class DataBase {
private List listeners =new ArrayList();
public void addActionListner(ActionListener foo){
listeners.put(foo);
}
public void changePartOfDatabase{
fireActionPerformed();
}
private void fireActionPerformed() {
for (int index = 0; index < listeners.length(); index++) {
ActionListener listener = (ActionListener)listeners.get(index);
listener.actionPerformed();
}
}
}
> Other objects interested in tracking changes would just add new
> Listener.
[quoted text clipped - 3 lines]
> keywords so I could google for it, if there is not please tell me how
> to write such a thing by myself.