In a functional language, a three dimensional vector of reals
(three-vector for short) could be a data structure holding three
real numbers
and a collection of functions operating on
vectors (
). In an object oriented
programming environment one might define a three-vector class,
combining the coordinates (the member data) with the vector functions
(the member methods), e.g.
.
The main advantages of the object
oreinted approach are data abstraction, encapsulation, and
inheritance. However, object orientation imposes certain
limitiations. For instance, when dealing with large numbers of
instances, an array of records,
![]() |
(1.1) |
![]() |
(1.2) |