Re: Buffer/String split, take2

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Wed, 21 Jan 2009 09:17:39 -0700

On 01/21/2009 02:47 AM, Kinkie wrote:
> On Tue, Jan 20, 2009 at 10:24 PM, Alex Rousskov
> <rousskov_at_measurement-factory.com> wrote:

>> * Universal Buffer:
>>
>> Blob = low-level raw chunk of RAM invisible to general code
>> Buffer = all-purpose user-level buffer

>> * Divide and Conquer (D&C):
>>
>> Blob = low-level raw chunk of RAM invisible to general code
>> Buffer = shareable Blob
>> IoBuffer = buffer optimized for I/O needs
>> String = buffer optimized for content manipulation
>> (note) A possible variation of the same design would be to move area
>> manipulation to Buffer.

> What I fear from the D&C approach is that we'll end up with lots of
> duplicate code between the 'buffer' classes, to gain a tiny little bit
> of efficiency and semantic clarity.

Significant code duplication among Buffer kids would mean that we are
adding classes that are not really needed or we are adding them
incorrectly (i.e., our Division is wrong). If we see these signs (and
they are usually quite clear), we should change the classes accordingly.

> If that approach has to be taken,
> then I'd rather take the variant of the note - in fact that's quite in
> line with what the current (agreeably ugly) code does.

The current code indeed places the area manipulation inside Buffer.

Alex.
Received on Wed Jan 21 2009 - 16:18:53 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 21 2009 - 12:00:26 MST