| ADTs vs. Objects |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||
| ADTs vs. Objects |
| define-record | |
| Scheme supports abstract data types (ADTs) through mechanisms such as define-record. |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||
| ADTs vs. Objects |
| define-record |
| Hide data to control access | |
| With ADTs, each data structure type is equipped with operators that manipulate elements of the type. All access to the structure should be through these operators. |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||
| ADTs vs. Objects |
| define-record |
| Hide data to control access |
| Objects enforce hiding | |
| Similarly, an object consists of a set of data fields together with a set of operators (called methods), only objects enforce data hiding: i.e. data fields may only be accessed via methods. |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||
| ADTs vs. Objects |
| define-record |
| Hide data to control access |
| Objects enforce hiding |
| Inheritance | |
| Objects also support inheritance, a form of subtyping in which new object types are derived from existing object types. |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||
| ADTs vs. Objects |
| define-record |
| Hide data to control access |
| Objects enforce hiding |
| Inheritance |
| Object-oriented programming (OOP) | |
| refers to the programming style that makes extensive use of objects and inheritance. |
| Last modified on July 2, 2001 by rpj@cs.rit.edu. | ||