On Tue, May 15, 2001 at 05:02:40PM -0400, Jason van Zyl wrote:
> I don't think validation should be made part of the database model.
> Validation has nothing to do a column in the database, you have
> to validate a piece of information that is entered at the application
> level. 

I think the line of application input validation and database input 
validation is a gray one.  Saying not null, default, unique are a form
of pushing input validation to the database server.  Column.java
is being used simply as the glue to get the data from the dtd into
the Peer.

The whole idea is to provide a lightweight mechanism so that users
can plug in their own form of doing input validation.
Once you say 
   <column name="email" .. inputValidator="org.apache...EmailValidator" />

You can then do the following:
   iv = peer.getInputValidator(EMAIL);
   if (iv.checkInput(input) {
   }
   else {
   }

   Also, if you have a form that doesn't map 1-1 with Peers, you can
   use the InputValidators directly e.g.

   HashMap map ..
   map.put("email", new EmailValidator());
   map.put("name", new NotEmptyValidor());
   ..
   util.checkInput(map, parameterParser);

   That tool is yet to be committed.  But it will also do
   util.checkInput(peer, parameterParser);
   where it will cycle through the pp checking the input against the peer
   validators.

   thanks for the input,  I'm not totally against not 
   using database/model/*.  But I need some way to make the association.

   mike





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

Reply via email to