[gclist] Finalization and object orientation.
Thu, 27 Mar 1997 15:28:26 -0600
Experts talk about the three corner stones of object
orientation. Encapsulation, inheritance and polymorphism.
And of these encapsulation is the most basic and vital.
Under encapsulation I will add finalization. Objects
get to clean up after themselves. This is often stated
as "Object orientation without garbage collection is
nonsense." As a key part of finalization is freeing storage.
But this isn't the only part of finalization. Objects can
free resources, update totals etc. Saying these things
can't be part of finalization breaks part of encapsulation.
Knowledge that should be hidden within an object must be
exposted to the environment.
Saying that things that must happen shouldn't be in
finalizers is deeply destructive to object orientation
and only makes sense if there was no way to do it right.
Charles Fiterman Geodesic Systems
414 North Orleans Suite 410 Phone 312 832 1221 x223
Chicago IL 60610-4418 FAX 312 832 1230
A computer language without garbage collection
is like a city without garbage collection.