I would be opposed to changing any interfaces, but adding new interfaces to
represent stacks seems sensible.

I have heard arguments before (eg. Joshua Bloch, Effective Java) that Stack
should not extend List as it is an independent data structure. I'm not
completely convinced, but it may not be a bad idea here.

What if the new IntStack interface doesn't extend List?
But the implementation implements both IntStack and IntList.
And potentially the IntStack definition might contain some methods from
IntList.

That way the user could get at the List aspect if they want, but normally
they are resticted to the Stack API.

Stephen

----- Original Message -----
From: "Rodney Waldhoff" <[EMAIL PROTECTED]>
> I've been doing a little clean-up of commons-primitives in order to move
> toward a 1.1 (or better) release.
>
> I notice that back in April several Stack implementations were introduced,
> with names like FloatStack and IntStack, etc.
>
> I wonder if:
>
> 1) in keeping with the XxxList implementations, if XxxStack should in fact
> be an interface, rather than a concrete class
>
> 2) we might be able to get away with simply adding the stack methods
> (push/peek/pop) to the XxxList interfaces, and providing adapters to and
> from the Object based Stack, as necessary.
>
> 3) we should make XxxStack descend from XxxCollection, at minimum
>
> Any thoughts?
>
> - Rod
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to