You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by Markus Wiederkehr <ma...@gmail.com> on 2009/02/01 21:12:22 UTC

Should TextBody and BinaryBody really be interfaces?

I wonder if it wouldn't be better to change TextBody and BinaryBody
into abstract subclasses of SingleBody.

For example BodyFactory returns instances of Text/BinaryBody that are
also SingleBody instances. With the current design the user has to
cast the objects to access the SingleBody methods..

Opinions?

Markus

Re: Should TextBody and BinaryBody really be interfaces?

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Sun, Feb 1, 2009 at 8:12 PM, Markus Wiederkehr
<ma...@gmail.com> wrote:
> I wonder if it wouldn't be better to change TextBody and BinaryBody
> into abstract subclasses of SingleBody.
>
> For example BodyFactory returns instances of Text/BinaryBody that are
> also SingleBody instances. With the current design the user has to
> cast the objects to access the SingleBody methods..
>
> Opinions?

with the revised design, i think abstract subclasses make more sense

- robert