Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!gore!jacob From: jacob@gore.com (Jacob Gore) Newsgroups: comp.lang.c++ Subject: Re: Do class libraries have to be in source form (2 of 4) Message-ID: <110009@gore.com> Date: 22 Nov 89 23:39:16 GMT References: <177@taumet.UUCP> Reply-To: jacob@gore.com (Jacob Gore) Organization: Gore Enterprises Lines: 29 (I wish this was in comp.object instead of comp.lang.c++.) I can give a very recent example of how lack of source can be an obstacle to reusability of a class. It is a case where the reuse would be in the form of making a subclass in order to modify the behavior of the objects. The NextStep (tm NeXT, I bet) Application Kit is a hierarchical class library (in Objective-C (tm Stepstone)). It contains class Matrix, which is a two-dimentional array of graphics objects (specifically, Cells). It has one limitation which makes it unusable for what I needed: all Cells must be of the same size (meaning X and Y size, not memory storage). In other words, you cannot use it to display a table, unless all columns are of the same width and all rows are of the same height. I considered making a Table class that would be a subclass of Matrix, but would allow each row to be of its own height and each column of its own width. This would involve overriding creation methods (easy), row and column manipulation methods (easy), display methods (I don't know), and mouse tracking methods (I don't know), as well as some new instance variables to support them. Why couldn't I reuse Matrix this way? Because of the "I don't know" parts. Not having the source to Matrix, I would have to either re-invent or reverse-engineer its display and mouse tracking methods. That is NOT reusability. Jacob -- Jacob Gore Jacob@Gore.Com boulder!gore!jacob