---
title: "Discussion on \"The Singleton pattern (Is singleton object safe?)\" | Hashnode"
description: "Discussion on \"The Singleton pattern (Is singleton object safe?)\". Hey. You can't initialize me, but you can get the only one instance of myself which is shared across your app by asking my static sub-routine. I can help you with what I can.\n -- Singleton class \n\n\n\nThis is a continuation of the software design patte..."
url: "https://hashnode.com/posts/singleton-pattern/5fc158bc2cae9c5b190b6b7d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Singleton pattern (Is singleton object safe?)](https://buildwithsammie.hashnode.dev/singleton-pattern?utm_source=hashnode&utm_medium=feed)

Hey. You can't initialize me, but you can get the only one instance of myself which is shared across your app by asking my static sub-routine. I can help you with what I can. -- Singleton class This is a continuation of the software design patte...

Nov 27, 2020 · 4 min read · buildwithsammie.hashnode.dev  
Read the article

-   [#2articles1week-1](https://hashnode.com/tag/2articles1week-1)
-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#java](https://hashnode.com/tag/java)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)

## Written by

[Samuel Johnson R](https://hashnode.com/@samiemovic)

@samiemovic · Tamil Nadu, India

  
[View profile](https://hashnode.com/@samiemovic)

Software Engineer by day. Ninja by night.

## Responses 1

Markdown supported · ⌘↵ to post

[Maxi Contieri](https://hashnode.com/@mcsee)

[Nov 28, 2020](https://hashnode.com/posts/singleton-pattern/5fc158bc2cae9c5b190b6b7d/comment/5fc259e755b779631e1acee7)

Nice article

In my opinion, Singleton should be always avoided. It is as dangerous as you mention because it brings lots of coupling

[maximilianocontieri.com/singleton-the-root-of-all…](https://maximilianocontieri.com/singleton-the-root-of-all-evil)

I have encountered singleton as logger many times and I wasn't able to test them (you can't test singletons)

So I wrote an article on how to decouple the logger (by removing the singleton) here.

[maximilianocontieri.com/how-to-decouple-a-legacy-…](https://maximilianocontieri.com/how-to-decouple-a-legacy-system)

I'm certain they're a lot of times when we need an object to be _well known_, and I think there are several better alternatives than making it Singleton.

I don't pretend to hijack your post. They are just my two cents.

[Samuel Johnson R](https://hashnode.com/@samiemovic)

[Nov 29, 2020](https://hashnode.com/posts/singleton-pattern/5fc158bc2cae9c5b190b6b7d/comment/5fc259e755b779631e1acee7#reply-5fc3308a2d08fb69499619a6)

That's such a good read. Gives a great clarity on how dangerous is Singleton pattern is. Thank you. :)
