Reification (computer science)
|
Reification, in the context of object-oriented programming, is the implementation of an abstract behavior.
As an example, one may have an abstract type Vehicle, which includes a data field called NumberOfWheels. One may then have two descendants, Car (with a 4) and Bicycle (with a 2). The pseudocode:
Vehicle MyVehicle; Car A_Car; A_Car = new Car; MyVehicle = A_Car; print MyVehicle.NumberOfWheels;
...will print 4, while:
Vehicle MyVehicle; Bicycle Bike; Bike = new Bicycle; MyVehicle = Bike; print MyVehicle.NumberOfWheels;
...will print 2.
Note that in both cases MyVehicle is of type Vehicle - it must thus be reified when the value of NumberOfWheels is required.Template:Compu-lang-stub