Using threading to do processing. Improving the User Experience.

One great thing about Java is that it’s easy to create Threads. My UML diagrams are showing how I am now splitting processing away from the user interface.

Why make a user wait, when a background thread could be fired to do a calculation, produce a report and it’s not only users that can benefit from background processing. I have a comms routine which basically get’s a UDP message, puts it in a database and responds to the unit. Then, in the background, runs a thread that processes the data into the system. 

To create a thread is very easy. You can either use an EJB timer function to start a threaded routine, or create a class that extends a Thread, and then use new Thread(new yourClass()).start();

 

Advertisements

About Paul C

I am a Senior Java programmer/Web Technologies, Play in a band called Mandolin Monday, I have a cat and I live on a boat.

Posted on January 5, 2012, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: