You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Jürgen Hoffmann <jh...@byteaction.de> on 2006/07/06 01:16:48 UTC

LONG: working on the parser

Hi Guys,

after studying a lot of avalon and components and existing codebase, i have 
come to a point where I have some questions about the parser.

Well DefaultParameterParser, DefaultCookieParser, StringValueParser all extend 
BaseValueParser. Now BaseValueParser implements (I)ValueParser. ValueParser 
is extended by (I)ParameterParser and (I)CookieParser. 

Other than those we have the CSV- and TSVParser which extend DataStreamParser 
and hence really have nothing to do with the component, as they could parse 
any fixed Value DataStream...

Now to my question. Do we really want one jar file for all possible Parsers 
and create a new Interface for the CSV/TSVParser and have then 4 components 
inside one jar file, or do we want to split this up further inside

fulcrum-baseparser
fulcrum-parameter-parser
fulcrum-cookie-parser
fulcrum-string-parser
fulcrum-csv-parser

have those components implement contextualizable, and make them lookup 
fulcrum-baseparser?

Another thing is that we have ParserUtils inside t2.3.2. ParserUtils check the 
TR.props for the desired folding. Now in Trunk there is a ParserUtils, but we 
do not want to use it, because this creates a dependency upon turbine, which 
is surely not what we want.

So to come by this, I made DefaultParameterParser implement Configurable, and 
added the necessary Methods (convertAndTrim) to the ValueParser Interface. 
Now why in there, and not to (I)ParameterParser? Because BaseValueParser has 
a method convert(String) which calls convertAndTrim(String). Henning solved 
this by creating the ParserUtils class, which was a basic Utility Class 
providing static Methods. Now because of the aforementioned probable 
dependency, I am asking what would be best. Keep ParserUtils, and create 
another static Method to set the desired UrlCaseFolding Value during 
Configuration of the Component, or keep it inside the Interface ValueParser?

Other than that my work of Migrations is fairly done. After you guys decided 
on what to do, I will create a patch for your review.
 
Should we at least create different packages for the Parsers that are 
dependant on BaseValueParser and those dependant on DataStreamParser?


Please let me know what you think.

-- 
Kind regards

Juergen 



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: LONG: working on the parser

Posted by Thomas Vandahl <th...@tewisoft.de>.
Jürgen Hoffmann wrote:

> Now to my question. Do we really want one jar file for all possible Parsers 
> and create a new Interface for the CSV/TSVParser and have then 4 components 
> inside one jar file, or do we want to split this up further inside
> 
> fulcrum-baseparser
> fulcrum-parameter-parser
> fulcrum-cookie-parser
> fulcrum-string-parser
> fulcrum-csv-parser
> 
> have those components implement contextualizable, and make them lookup 
> fulcrum-baseparser?

I'd vote for the single jar. The parsers are closely interconnected and 
  in quite heavy use. I suspect performance issues if they need to 
lookup  another instance every time. Other than that, the split-up would 
need a lot more stuff in the container configuration, which can be 
screwed up.

> Another thing is that we have ParserUtils inside t2.3.2. ParserUtils check the 
> TR.props for the desired folding. Now in Trunk there is a ParserUtils, but we 
> do not want to use it, because this creates a dependency upon turbine, which 
> is surely not what we want.
> 
> So to come by this, I made DefaultParameterParser implement Configurable, and 
> added the necessary Methods (convertAndTrim) to the ValueParser Interface. 
> Now why in there, and not to (I)ParameterParser? Because BaseValueParser has 
> a method convert(String) which calls convertAndTrim(String). Henning solved 
> this by creating the ParserUtils class, which was a basic Utility Class 
> providing static Methods. Now because of the aforementioned probable 
> dependency, I am asking what would be best. Keep ParserUtils, and create 
> another static Method to set the desired UrlCaseFolding Value during 
> Configuration of the Component, or keep it inside the Interface ValueParser?

I think that setting the value during configure() is exactly the way the 
components are meant to work. I understand that this is a method for 
internal string handling anyway, isn't it?

> Should we at least create different packages for the Parsers that are 
> dependant on BaseValueParser and those dependant on DataStreamParser?

Feel free to use whatever structure you find useful.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org