• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handling long running events in the GUI

 
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have long running events, so no need to handle them
 
Sean Keane
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
reply
    Bookmark Topic Watch Topic
  • New Topic