I'd like to check-in the changes I've made to the IntakeService as discussed
earlier on the List. The changes are numerous but relatively small.
Hopefully things should be a little clearer as to how it works and paves
the road for further improvements after 2.3 is out the door.

I'll give a quick run-down here as to the main things that been
added/altered. To whom should I send the new files/diffs??

Reasoning behind changes:

I was experiencing difficulty in validating (specifically) numbers, found
the implementation of a number of validations to be unclear and found
duplication of code. The validation of numbers was based on using BigDecimal
for all number types. This has been seperated to support shorts/longs etc.
which now all subclass an abstract NumberValidator which in turn subclasses
an abstract DefaultValidator which as BaseClass contains all Rules/info
which are common to all Validators. StringValidator is therefore a subclass
of DefaultValidator and deals only with Strings as the name says.

UML diagram is available upon request.

1. package org.apache.turbine.services.intake.model;

Added:
A) ShortField - to support Shorts
B) LongField -  to support Longs

Changed:
A) FieldFactory  - to support afore mentioned new Fields
B) StringKeyField - deprecated

2. package org.apache.turbine.services.intake.validator;

Added:
A) BigDecimalValidator - extends NumberValidator and validates BigDecimals
B) DoubleValidator - extends NumberValidator and validates Doubles
C) FloatValidator - extends NumberValidator and validates Floats
D) LongValidator - extends NumberValidator and validates Longs
E) ShortValidator - extends NumberValidator and validates Shorts
F) StringValidator  - subclasses DefaultValidator and validates Strings

Changed:
A) DefaultValidator - Abstract Base class for all Validators
B) NumberValidator - Abstract class that extends DefaultValidator to deal
with number types
C) IntegerValidator - extends NumberValidator and validates Ints
D) FileValidator - extends DefaultValidator

I'd like to have these changes tested by others, welcome feedback and will
fix any probs should they emerge.

Colin




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

Reply via email to