Tag » Singleton

Whiskey Lore From Yore...

I didn’t know there was actually a World Whiskey Day until I was square in the middle of it! Going by the kind of loving Moms and Pas get on… 722 altre parole


Church and the child free singleton

Reasons why child free singleton Bridget Jones might not like church

1. Parish churches can be somewhat dominated by social functions that require catering and other homemaker arts. 450 altre parole


Future bf: My top 4 list.

This has been on my mind a lot lately – here’s how it started. I was listening to a podcast (big shocker, I know), and they were talking about how important it is to date someone that has the same needs in a partner as you do. 768 altre parole

Holly A. Phillips

Pregnant with Baby #4

So I am now almost 18 weeks pregnant and there is one thing I have learned that I would like to share with you (even though I have read this before I didn’t believe it) 258 altre parole


The Only Single Instance You Will Ever Need

The most easiest to learn and probably the most widely used design pattern has to be the Singleton pattern right? Well, maybe the latter, but learning how to implement the Singleton design pattern is easy until you start reading about all the problems you can run into with regards to multiple threads creating an instance of your class. 189 altre parole


No, I'm not getting a pet.

“Don’t you at least have a pet?”

I’ve lost count of how many times I’ve been asked this question.  For me, it came on the scene around my late 20s and cemented itself as a staple in my early 30s.   630 altre parole


[Java] Simple thread-safe singleton class

public class threadSafeSingleton {

  //objects in singleton
  private HashMap<String, String> myHashMap = new HashMap<String, String>();
  private static threadSafeSingleton singletonInstance = null;

  protected threadSafeSingleton() {
  public static threadSafeSingleton getSingleton() {
    if (singletonInstance == null) {
      singletonInstance = new threadSafeSingleton();
    return singletonInstance;