Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1870

Add support for singleton pattern

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      The singleton pattern has become a standard tool in almost any Java program. It is used to:

      • Create constants
      • Lazy load expensive classes

      The current implementations suffer from:

      • A whole lot of code to implement the singleton
      • Synchronization issues
      • Testing issues

      I have attached an example syntax to make singletons first class citizens on Groovy.

      Attachments

        1. Singleton.groovy
          1 kB
          Aaron Digulla
        2. Singleton.groovy
          1 kB
          Aaron Digulla

        Activity

          People

            blackdrag Jochen Theodorou
            digulla Aaron Digulla
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: