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:

    Some ghosts are women,
    neither abstract nor pale,
    their breasts as limp as killed fish.
    Anne Sexton (1928–1974)

    The American man is a very simple and cheap mechanism. The American woman I find a complicated and expensive one. Contrasts of feminine types are possible. I am not absolutely sure that there is more than one American man.
    Henry Brooks Adams (1838–1918)