commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject Re: [Validator] Extending ISBN validator to support smooth transition to ISBN-13 / EAN-13 standard
Date Fri, 26 May 2006 17:54:00 GMT
2006/5/25, Niall Pemberton <niall.pemberton@gmail.com>:
> On 5/25/06, Gabriel Belingueres <belingueres@gmail.com> wrote:
> > Hi,
> >
> > I just revised the ISBNValidator to support ISBN-13 / EAN-13
> > standards, which will begin its use on 2007 (see
> > http://www.isbn.org/standards/home/isbn/transition.asp for more
> > information).
> >
> > To support a smooth transition, I changed the isValid(String) method
> > so that it can validate all ISBN-10, ISBN-13 and EAN-13 codes. In
> > addition, I created methods for validating only ISBN-10, only EAN-13,
> > or ISBN-13 / EAN-13 codes.  This way, anyone could have support for
> > the new standard by just changing the .jar file.
> >
> > I'll be uploading to Jira as an enhancement today if I have the time.
>
> Excellent, thanks for this - I wasn't aware of the transition.
>
> I started a process of separting out the framework aspects of
> validator from the actual validation routines. So far I have just
> added date/time/number validators to the new "routines" package (see
> http://tinyurl.com/eahub) - but the plan is/was to move other
> validators, such as ISBN, credit card, email, url etc also into that
> package and deprecate the existing ones. This also provides the
> opportunity to rethink the design of some of these validators.
>
> My first thoughts on this are that rather than just providing a
> monlithic ISBN validator it would be useful if we could break it down
> into more reusable components:
>
>  - modulus 11 check digit calculation / validation
>  - EAN Number validation
>  - ISBN Number validaition

It could be a good idea to provide different validator components for
different ISBN codes, however I decided by now to just expand the
functionality of the isValid method to allow for actual applications
to upgrade to ISBN-13 with minimal effort.

This decision came to a price though, since mixing different ISBN code
validations in the same class forced me to write different isValidXXXX
methods, that were outside of the isValid() standard coding patterns I
see in the current validators.

> Probably best if further discussion is either done on the dev list -
> or Jira ticket.

(I'm not in the dev list because is kind of verbose)

> Niall
>
>
> > Regards,
> > Gabriel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

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


Mime
View raw message