Advanced | Help | Encyclopedia
Directory


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.








Links: Addme | Keyword Research | Paid Inclusion | Femail | Software | Completive Intelligence

Add URL | About Slider | FREE Slider Toolbar - Simply Amazing
Copyright © 2000-2008 Slider.com. All rights reserved.
Content is distributed under the GNU Free Documentation License.