You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/12/19 22:27:29 UTC
[VOTE] Alter CircularBuffer's API
I would like to alter the CircularBuffer's API (using deprecation of course) with the
following cosmetic changes:
class CircularBuffer
{
add( Object obj ); // was append()
Object remove(); // was get()
int size(); // was getContentSize()
int isEmpty(); // remains the same
}
I would also like to deprecate the getBufferSize(), unless someone can give me a practical
reason for it's use. CircularBuffer does resize itself, so it's buffer size does not need
to be managed externally. If you want to fix the size of the CircularBuffer, you have to
rely on a constant value that does not change--so getBufferSize() won't work for that
purpose. It may be necessary for the internal functions, but it can be encapsulated inside
with a private accessor.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [VOTE] Alter CircularBuffer's API
Posted by Berin Loritsch <bl...@apache.org>.
Peter Donald wrote:
> Hi,
>
> Instead of deprecating since it is such a small class would it not be better
> to just create a new class that has your desired interface and deprecate old
> class complete. Perhaps have your new class named CircularArrayBuffer or
> something. That way you don't have to worry about backwards compat.
+1
>
> On Thu, 20 Dec 2001 08:27, Berin Loritsch wrote:
>
>>I would like to alter the CircularBuffer's API (using deprecation of
>>course) with the following cosmetic changes:
>>
>>class CircularBuffer
>>{
>> add( Object obj ); // was append()
>> Object remove(); // was get()
>>
>> int size(); // was getContentSize()
>>
>> int isEmpty(); // remains the same
>>}
>>
>>I would also like to deprecate the getBufferSize(), unless someone can give
>>me a practical reason for it's use. CircularBuffer does resize itself, so
>>it's buffer size does not need to be managed externally. If you want to
>>fix the size of the CircularBuffer, you have to rely on a constant value
>>that does not change--so getBufferSize() won't work for that purpose. It
>>may be necessary for the internal functions, but it can be encapsulated
>>inside with a private accessor.
>>
>
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [VOTE] Alter CircularBuffer's API
Posted by Berin Loritsch <bl...@apache.org>.
Peter Donald wrote:
> Hi,
>
> Instead of deprecating since it is such a small class would it not be better
> to just create a new class that has your desired interface and deprecate old
> class complete. Perhaps have your new class named CircularArrayBuffer or
> something. That way you don't have to worry about backwards compat.
How about naming it AvalonBuffer?
>
> On Thu, 20 Dec 2001 08:27, Berin Loritsch wrote:
>
>>I would like to alter the CircularBuffer's API (using deprecation of
>>course) with the following cosmetic changes:
>>
>>class CircularBuffer
>>{
>> add( Object obj ); // was append()
>> Object remove(); // was get()
>>
>> int size(); // was getContentSize()
>>
>> int isEmpty(); // remains the same
>>}
>>
>>I would also like to deprecate the getBufferSize(), unless someone can give
>>me a practical reason for it's use. CircularBuffer does resize itself, so
>>it's buffer size does not need to be managed externally. If you want to
>>fix the size of the CircularBuffer, you have to rely on a constant value
>>that does not change--so getBufferSize() won't work for that purpose. It
>>may be necessary for the internal functions, but it can be encapsulated
>>inside with a private accessor.
>>
>
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [VOTE] Alter CircularBuffer's API
Posted by Peter Donald <pe...@apache.org>.
Hi,
Instead of deprecating since it is such a small class would it not be better
to just create a new class that has your desired interface and deprecate old
class complete. Perhaps have your new class named CircularArrayBuffer or
something. That way you don't have to worry about backwards compat.
On Thu, 20 Dec 2001 08:27, Berin Loritsch wrote:
> I would like to alter the CircularBuffer's API (using deprecation of
> course) with the following cosmetic changes:
>
> class CircularBuffer
> {
> add( Object obj ); // was append()
> Object remove(); // was get()
>
> int size(); // was getContentSize()
>
> int isEmpty(); // remains the same
> }
>
> I would also like to deprecate the getBufferSize(), unless someone can give
> me a practical reason for it's use. CircularBuffer does resize itself, so
> it's buffer size does not need to be managed externally. If you want to
> fix the size of the CircularBuffer, you have to rely on a constant value
> that does not change--so getBufferSize() won't work for that purpose. It
> may be necessary for the internal functions, but it can be encapsulated
> inside with a private accessor.
--
Cheers,
Pete
"The ability to quote is a serviceable substitute for wit." -- Maugham
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [VOTE] Alter CircularBuffer's API
Posted by Jeff Turner <je...@socialchange.net.au>.
On Wed, Dec 19, 2001 at 04:27:29PM -0500, Berin Loritsch wrote:
> I would like to alter the CircularBuffer's API (using deprecation of course) with the
> following cosmetic changes:
>
> class CircularBuffer
> {
> add( Object obj ); // was append()
> Object remove(); // was get()
>
> int size(); // was getContentSize()
>
> int isEmpty(); // remains the same
> }
>
> I would also like to deprecate the getBufferSize(), unless someone can give me a practical
> reason for it's use. CircularBuffer does resize itself, so it's buffer size does not need
> to be managed externally. If you want to fix the size of the CircularBuffer, you have to
> rely on a constant value that does not change--so getBufferSize() won't work for that
> purpose. It may be necessary for the internal functions, but it can be encapsulated inside
> with a private accessor.
+1
--Jeff
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>