Since no one has asked yet, and I've yet to find a suitable answer; simply put: What is a Degenerate Class?
Examples of various languages would be helpful...Except UML. :P
Since no one has asked yet, and I've yet to find a suitable answer; simply put: What is a Degenerate Class?
Examples of various languages would be helpful...Except UML. :P
I'm also looking for a definitive answer, here's how I've understood it so far from google:
In mathematics, degeneracy signifies the limiting case in which a class of object changes its nature so as to belong to another, usually simpler, class.
In programming, following this concept of 'collapsing' into something simpler, degeneracy seems to be used in a number of ways:
Finally, you have seen classes with only a main method. Their sole purpose is to start a program. From a design perspective, these are somewhat degenerate examples of classes.
Effective Java 2nd edition:
Item 14: In public classes, use accessor methods, not public fields
Occasionally, you may be tempted to write degenerate classes that serve no purpose other than to group instance fields:
// Degenerate classes like this should not be public!
class Point {
public double x;
public double y;
}
For example, the class of List and List share the plain old Java class List. List is called the raw type of the generic class. Every generic has a raw type. It is the degenerate, “plain” Java form from which all of the generic type information has been removed and the type variables replaced by a general Java type like Object.
Effective Java 2nd edition:
// The worst possible legal hash function - never use!
@Override public int hashCode() { return 42; }
It’s legal because it ensures that equal objects have the same hash code. It’s atrocious because it ensures that every object has the same hash code. Therefore, every object hashes to the same bucket, and hash tables degenerate to linked lists.
Big Java:
However, sometimes you get into philosophical questions dealing with degenerate inputs: empty strings, shapes with no area, and so on.
From here I'm guessing that it's a class with no behavior (i.e. no methods).