question about callback of model state change

Should I refresh each client if the model state change?if should,the DBAccess Interface specified by Sun has no method such as addChangeListener(View v),how can I add each View to the model?appreciate your reply.

There is no requirement for this, and it is not something that is typically done in real life - consider a real reservation system (hotel / airline / ...): there is no way that they would update the millions of connected clients every time a customer makes a booking.

If you did want to do this, you might want to consider the fact that your Data class must implement a specified interface, but there is nothing to say that it cannot implement other interfaces or have extra methods as well .

thanks, I will extend my DBAccess Interface. But I think that it is necessary for this especially in real time system.In a small C/S system,there isn't many clients.In Sun's SCJD teaching material,they have finished this.Observer design pattern can also help us. I am sorry that I am beginner in English,it takes you more time to understand what I said.

Your English is better than many people I know who claim English as their first language.

As far as the Observer pattern, I am considering implementing it as well. Given the relatively small number of clients expected for this application, it would be a practical decision. I have B&S 2.2.3, and my specification states that the client will be used only by a team of Customer Service Reps, and "The IT director does not anticipate much reuse of the first Java technology system, but intends to use that system as a learning exercise before going on to a web based system."

Has anyone used the Observer pattern with RMI before?

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook

I asked sun if I could insert a method getScheme in BBMain interface, they said I MUST not insert or remove methods of this interface.

About update the client when the data base changes (my assignemt is that of CSR of Scarper LCC...), when the user presses the book button, first I try to lock, then I read the record and update the table acordingly.

well, that's it. Itapaj� Takeguma. SCJD in progress....

xiangyang li
Greenhorn

Joined: Sep 15, 2004
Posts: 3

posted Sep 16, 2004 19:03:00

0

I asked sun if I could insert a method getScheme in BBMain interface, they said I MUST not insert or remove methods of this interface.

I didn't express my meaning clearly,I mean that I create a new Interface that extends DBAccess.

when the user presses the book button,lock and read the latest record,I think that It is also a choice.thanks.