Validation and the Visitor

From: Dagfinn Reiersol (dagfinn_at_howamazing.com)
Date: 08/11/04


Date: Wed, 11 Aug 2004 11:14:21 +0200

I was interested to see the comments on user input validation in the
3-tier thread. I have a sneaking feeling that the subject is an
under-focused one and that it it both common enough and unique enough
that it needs its own "theory of validation" or perhaps its own design
patterns.

There is a recent article in Java World on "Validating value objects":

http://www.javaworld.com/javaworld/jw-06-2004/jw-0614-validate.html'

(Note: This is the term "value object" in the J2EE patterns sense.)

The example uses the Visitor pattern. My problem is I'm unable to see
how the Visitor is actually necessary. To me it looks like just a fancy
and pretentious way of passing the validatable object to the validator.

I'm not a Java programmer, so I may have missed something. Would anyone
care to have an opinion on it?



Relevant Pages

  • Re: OOD/OOP and databases
    ... I would recommend Joshua Kerievsky's book "Refactoring to Patterns" by ... If I went the Self-Evaluating Rule approach I would consider making ... > business rules is much more than validation. ...
    (microsoft.public.dotnet.general)
  • Re: Multiple perimeter service routers?
    ... Have you read the "Web services security patterns" published by the Patterns ... place to do message validation because the message must be decrypted to ... So I wonder if you could have two PSRs, one of which resides on the ... So a perimeter service router actually routs to an internal service ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Is this efficient way to validate phrase against collection of regular expressions
    ... > validation of the phrase against a collection of patterns? ... My fear is ... > this is pretty intense way of validating the pattern of the phrase. ...
    (comp.lang.java.programmer)