• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

logistics of automatically updating java desktop app

Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't usually have much trouble figuring out appropriate designs so that my code is flexible and easily extended. But now I'm writing a desktop app in java and realizing that though I've written plenty of flexible code, I've never actually experienced the process of extending it after it has already been installed on somebody's machine somewhere out there on the internet. Say I have a class called Widget, and I've come up with an improved version, which is a subclass of widget (ExtendedWidget). I want the desktop app to query the server, realize ExtendedWidget is available and should replace Widget, download and install ExtendedWidget, and then reboot using the extended class rather than the original one.

Haven't had time to think about this extensively, but here's what comes to mind initially. The app is deployed in a jar file, but has files with the saved work of the user. I could put a directory within that structure, say "updates" which is a neighbor to the directory where the user's work is stored. After downloading the new class file I put it into the "updates" folder, then reboot the app. The app has its class loader fixed to where it first loads classes from the "updates" directory, loading classes from the jar file only if they are not first found in the "updates" directory.

So... what do y'all think? Is this a good idea? Is there some kind of design pattern out there somewhere that addresses this issue in a better way?

Thanks for your time in reading this long post!
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

A good approach can be of first thinking of a way to register components.
Not aware of any patterns for it .

some idea's do come to my mind:
Use a file which will be the register/log for all installed components.
when the application initializes/restarts/starts it should read the file .

File can have parameters like : name of component,parent window etc with some low/high level details.

anyways this place is full of experienced people who can guide us.

another approach :

[ May 24, 2008: Message edited by: sanjay kumar ]
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to take a look at Java Webstart.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!