otypes
Otypes are a formal concept used in some type-theory frameworks to describe object types defined by explicit interfaces. An otype specifies a contract that objects must satisfy, consisting of a set of named properties (fields) and a set of operations (methods) with declared input and output types. Objects typed as an otype are expected to provide the declared structure and behavior, enabling static reasoning about program correctness and data interchange.
Structurally, an otype combines data shape and behavior. The properties describe the visible state an object
Typing discipline for otypes can be static, dynamic, or hybrid. In static settings, a compiler checks that
Examples illustrate the concept: an otype Point2D might require x and y as numbers and a method
See also: type system, structural typing, nominal typing, subtyping, object-oriented programming.