Question

I've been reading Wirth's books on Oberon--or at least trying to--and I'm hitting a mental road block when it comes to figuring out what is going on regarding object oriented programming in Oberon.

I know his method is supposed to simplify object oriented programming by avoiding "standard" OOP syntax, which he labels a perpetration, as if it was somehow criminal, and maybe I'm just too rooted in class, method, etc... kind of thinking, but can someone translate Oberon's method into standard OOP language, or at least conceptually explain it.

Was it helpful?

Solution

You may get some insight by comparing Ada's tagged type, examined in Ada 95 Rationale: II.1 Programming by Extension, with Oberon-2's type tag, discussed in Object-Oriented Programming in Oberon-2: Run-Time Data Structures, cited here. Both use a record structure with hidden type information to implement inheritance and polymorphism. See also A Comparison of the Object-Oriented Features of Ada 95 and Java, cited here.

Addendum: So are they simply associating procedures with records?

An Oberon record type encapsulates both procedures and data, in a manner similar to the object type in Object Pascal. An Ada tagged record encapsulates the data, while the enclosing package encapsulates the subprograms and record.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top