Java
Double-Checked Locking in Synchronized Java Code
Submitted by bsarsgard on Thu, 05/01/2008 - 3:46pm.I learned a fun bit of java trivia the other day, that I thought I'd share. Let's say you have a lazy-loaded singleton design including the following code:
...
public static MySingletonClass getInstance() {
if (instance == null) {
instance = new MySingletonClass();
}
return instance;
}
...Of course, in a threaded application, you'll want to make the setting synchronized, so you can be sure that two threads calling getInstance() simultaneously for the first time don't create it twice. So all you need to do is synchronize it, right?
SingleInstanceService and Alternatives with Java Web Start
Submitted by bsarsgard on Wed, 04/30/2008 - 10:53pm.Matt and I have been experimenting with part of the JNLP API called SingleInstanceService. Basically, it's a sort of super-static singleton class that's shared between all running instances of the application. This is really cool in theory, as it allows you do do things like count the number of running instances, and allow only one. There's some great code implementation examples, as well.
The Johns Hopkins Hospital Brady Urological Institute
Problem: Tissue Micro-Arrays (TMA) are slides containing 400 distinct patient specimens on a single slide. BUI needed to catalog slides, patients on each slide, how slides were stained, diagnosis for each specimen and scanned image of each specimen. Their in-house MS Access prototype quickly reached limitations, particularly with inability to handle multiple organ systems. There were also concerns about keeping their applications HIPAA compliant.
LJS & Associates, Inc.
Problem: LJS has 96% market-share in residential real-estate sign-post installation and removal in the Mid Atlantic area. They were using a DOS-based database system for order tracking and the system had many problems including that it could not handle email orders. LJS was also starting to expand nationally on it’s own and through a dealer/franchise network and needed an application that could handle all of that.


