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
Degenerate is defined as a person who is immoral, corrupt or sexually perverted. An example of a degenerate is a thief.
In mathematics, something is called degenerate if it is a special case of an object which has, in some sense, “collapsed” into something simpler. For example: A degenerate triangle has all three of its vertices lying on the same straight line, so the triangle is squashed completely flat.
In mathematics, a degenerate case is a limiting case of a class of objects which appears to be qualitatively different from (and usually simpler than) the rest of the class, and the term degeneracy is the condition of being a degenerate case.
As a descriptive term, degenerate describes the redundancy of the genetic code. A degenerate code refers to any of the codon combinations that lead to the same amino acid. In other words, an amino acid may be specified by more than one type of codon. A codon is a set of three adjacent nucleotides in mRNA.
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:
Big Java:
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;
}
Learning Java:
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With