• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling long running events in the GUI

 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just wondering how far people went with the GUI when it came to handling long running events? Did you spawn off a separate thread so that the processing was not being carried out on the EDT?

This article here describes the recommended approach for handling processing that may take a long time.

So for example in this assignment things like connect to the database file in standalone mode, connecting the the server in network mode, booking a room, etc.

I guess I should spawn these operations off to a separate thread. But as we know when it comes to threads - the more you have, the more chances for errors!!!
 
Roel De Nijs
Sheriff
Posts: 10442
136
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have long running events, so no need to handle them
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any event that involves network communication can be a long running event as it depends on the network quality. So every solution to this assignment has events that are potentially long running.

When running the client in network mode try entering an incorrect server name/address. Or try connecting when the server is down. Both scenarios will result in an event that does not return instantaneously.

Even in normal usage of your client application in network mode you have the possibility of long running events if there is a poor network connection.
 
Roel De Nijs
Sheriff
Posts: 10442
136
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean Keane wrote:Any event that involves network communication can be a long running event as it depends on the network quality. So every solution to this assignment has events that are potentially long running.

Of course I'm aware of that, just indicating I didn't execute any operation in a seperate thread.

So when you enter some wrong server address, it takes indeed some time and the application freezes for a certain time period.
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, so you had long running events, but executed them on the EDT rather than choosing to spawn them off to separate threads.

Obviously the examiners are not too bothered about this based on your score

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic