Abstract Type - Use of Abstract Types

Use of Abstract Types

Abstract types are an important feature in statically typed OO languages. Many dynamically typed languages have no equivalent feature (although the use of duck typing makes abstract types unnecessary); however traits are found in some modern dynamically-typed languages.

Some authors argue that classes should be leaf classes (have no subtypes), or else be abstract.

Abstract types are useful in that they can be used to define and enforce a protocol; a set of operations which all objects that implement the protocol must support.

Read more about this topic:  Abstract Type

Famous quotes containing the words abstract and/or types:

    The Germans are always too late. They are late, like music, which is always the last of the arts to express a world condition,—when that world condition is already in its final stages. They are abstract and mystical.
    Thomas Mann (1875–1955)

    The rank and file have let their servants become their masters and dictators.... Provision should be made in all union constitutions for the recall of leaders. Big salaries should not be paid. Career hunters should be driven out, as well as leaders who use labor for political ends. These types are menaces to the advancement of labor.
    Mother Jones (1830–1930)