wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes question about callback of model state change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "question about callback of model state change" Watch "question about callback of model state change" New topic
Author

question about callback of model state change

xiangyang li
Greenhorn

Joined: Sep 15, 2004
Posts: 3
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.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi xiangyang li,

Welcome to JavaRanch and this forum.

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 .

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
xiangyang li
Greenhorn

Joined: Sep 15, 2004
Posts: 3
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.
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
I am sorry that I am beginner in English
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
Itapaj� Takeguma
Ranch Hand

Joined: Jul 21, 2004
Posts: 41
I will extend my DBAccess Interface.


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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about callback of model state change
 
Similar Threads
Decoupling the GUI
Layerered H-MVC - flow of control
Confused with MVC
Still having some trouble with Observer/Observable
passed 151/155!!!