What's new? | Help | Directory | Sign in
Google
google-singleton-detector
Find singletons and global state in Java programs
  
  
  
  
    
Search
for
Updated Apr 29, 2008 by PaulHammant
Fingleton  
Information about the 'Fingleton' types

Fingleton

Description

Derived from "field singleton,” a Fingleton is a class which contains static fields. Many will consider these edge cases and not want to report on them.

Criteria

Fingletons have at least one public static field.

Example

public class Fingleton {
  public static Foo instance;
}

If the public static were for a field of type int or a String, and it were final then this would be a constant (and harmless)

If it were public static and final and making a complex object, then it is not clear whether its harmless or not. The complexity of the class is important, but were making a blanket assumption here - Foo (as above) could be a very stateful and method-packed class. If it is then a system that is engineered in this way is no better than one that has fist-class singletons.


Sign in to add a comment