Well, I keep changing unit dbf and some of the included ones. Like, I needed to overwrite AutoInc fields and change the field with the next value. All fields of TDbf are private, unfortunately. One of them,
inherits from TPagedFile, which does those things. Like, it has this function:
procedure ApplyAutoIncToBuffer(DestBuf: TRecordBuffer);
which I need to change, which is unfortunately not virtual.
And I'm part of a team, it would be nice if my teammates had the same version, which is diverging from trunk. The last bugfix submitted is not merged with trunk yet, so I have to maintain my own version.
But I would prefer to keep the changes as small as possible, if possible by making new classes that inherit from and replace those. Not by duplicating 9 units with thousands of lines of code.
@Zvoni: more like this:
begin
C1:=Class1.Create;
C2:=Class2.Create;
C1.MyItem:=Item1.Create;
C2.MyItem:=Item1.Create; // <-- This is done by an existing class, that knows nothing about Class2 or Item2.
C1.MyItem.Free;
C2.MyItem.Free;
C1.Free;
C2.Free;
end.