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/26 16:05:50 UTC

Interface Field

The newly introduced interface mime4j.parser.Field misses some of the
method that where previously available in class mime4j.class.Field.

The methods are still there but the user has to cast to AbstractField
(with instanceof check of course) to gain access to them..

Now the question is should we pull up some of the methods, remove them
or move them to other places?

IMO there are three categories of methods:

1) the static methods parse(ByteSequence), parse(String) and getParser()

These are still accessible but Field.parse() felt natural whereas
AbstractField.parse() feels clumsy in my opinon.. I would prefer a
separate class for these.

2) isValidField(), getParseException()

Pull up?

3) isContentType(), isSubject(), isFrom() and isTo()

Feels arbitrary and incomplete.. remove?

Cheers,
Markus

PS: We can address some or all of these issues in 0.7 of course..

Re: Interface Field

Posted by Markus Wiederkehr <ma...@gmail.com>.
On Fri, Feb 27, 2009 at 3:39 PM, Robert Burrell Donkin
<ro...@gmail.com> wrote:
> On Thu, Feb 26, 2009 at 7:58 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
>> Markus Wiederkehr wrote:
>>>
>>> The newly introduced interface mime4j.parser.Field misses some of the
>>> method that where previously available in class mime4j.class.Field.
>>>
>>> The methods are still there but the user has to cast to AbstractField
>>> (with instanceof check of course) to gain access to them..
>>>
>>> Now the question is should we pull up some of the methods, remove them
>>> or move them to other places?
>>>
>>> IMO there are three categories of methods:
>>>
>>> 1) the static methods parse(ByteSequence), parse(String) and getParser()
>>>
>>> These are still accessible but Field.parse() felt natural whereas
>>> AbstractField.parse() feels clumsy in my opinon.. I would prefer a
>>> separate class for these.
>
> +1

I'll look into it tomorrow. The rest is done..

Markus

>
>>> 2) isValidField(), getParseException()
>>>
>>> Pull up?
>>>
>>
>> I personally would rather keep Field interface as generic ad simple as
>> possible. I agree static parsing methods should go to a separate class.
>> isValidField(), getParseException() do not belong to Field, in my opinion.
>
> IMHO they don't really seem to belong in AbstractField either. perhaps
> a subinterface or empty abstract class (ParsedField?) would be better.
>
>>> 3) isContentType(), isSubject(), isFrom() and isTo()
>>>
>>> Feels arbitrary and incomplete.. remove?
>>>
>>
>> +1 to remove.
>
> +1
>
> - robert
>

Re: Interface Field

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Thu, Feb 26, 2009 at 7:58 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
> Markus Wiederkehr wrote:
>>
>> The newly introduced interface mime4j.parser.Field misses some of the
>> method that where previously available in class mime4j.class.Field.
>>
>> The methods are still there but the user has to cast to AbstractField
>> (with instanceof check of course) to gain access to them..
>>
>> Now the question is should we pull up some of the methods, remove them
>> or move them to other places?
>>
>> IMO there are three categories of methods:
>>
>> 1) the static methods parse(ByteSequence), parse(String) and getParser()
>>
>> These are still accessible but Field.parse() felt natural whereas
>> AbstractField.parse() feels clumsy in my opinon.. I would prefer a
>> separate class for these.

+1

>> 2) isValidField(), getParseException()
>>
>> Pull up?
>>
>
> I personally would rather keep Field interface as generic ad simple as
> possible. I agree static parsing methods should go to a separate class.
> isValidField(), getParseException() do not belong to Field, in my opinion.

IMHO they don't really seem to belong in AbstractField either. perhaps
a subinterface or empty abstract class (ParsedField?) would be better.

>> 3) isContentType(), isSubject(), isFrom() and isTo()
>>
>> Feels arbitrary and incomplete.. remove?
>>
>
> +1 to remove.

+1

- robert

Re: Interface Field

Posted by Oleg Kalnichevski <ol...@apache.org>.
Markus Wiederkehr wrote:
> The newly introduced interface mime4j.parser.Field misses some of the
> method that where previously available in class mime4j.class.Field.
> 
> The methods are still there but the user has to cast to AbstractField
> (with instanceof check of course) to gain access to them..
> 
> Now the question is should we pull up some of the methods, remove them
> or move them to other places?
> 
> IMO there are three categories of methods:
> 
> 1) the static methods parse(ByteSequence), parse(String) and getParser()
> 
> These are still accessible but Field.parse() felt natural whereas
> AbstractField.parse() feels clumsy in my opinon.. I would prefer a
> separate class for these.
> 
> 2) isValidField(), getParseException()
> 
> Pull up?
>

I personally would rather keep Field interface as generic ad simple as 
possible. I agree static parsing methods should go to a separate class. 
isValidField(), getParseException() do not belong to Field, in my opinion.

> 3) isContentType(), isSubject(), isFrom() and isTo()
> 
> Feels arbitrary and incomplete.. remove?
> 

+1 to remove.

Oleg

> Cheers,
> Markus
> 
> PS: We can address some or all of these issues in 0.7 of course..