Open Types and Bidirectional Relationships as an Alternative to Classes and Inheritance

Christian Heinlein
2007 Journal of Object Technology  
Open types are presented as a simple yet powerful data model for statically typed procedural and object-oriented programming languages, that overcomes the limitations of the traditional record-oriented model. The basic idea is to separate type definitions from the definitions of their attributes in order to allow incremental definitions of the latter. Furthermore, bidirectional relationships are introduced as pairs of mutually inverse attributes whose values will be kept consistent
more » ... . Finally, anonymous and automatic attributes are presented as a simple extension of attributes that unifies the concepts of aggregation, inheritance (including subtype polymorphism), and user-defined type conversions. Since open types do not possess methods in the objectoriented sense, global virtual functions are used as an alternative and more flexible means to define behaviour, while modules are employed to achieve information hiding and type-safe separate compilation. The basic implementation ideas of open types as a language extension for C++ are described.
doi:10.5381/jot.2007.6.3.a3 fatcat:mot5adcly5dnvgjoyiiub2yl3m