Reply to Re: At what point should I implement validation?

Your name:

Reply:


Posted by Phil Latio on 06/22/07 15:30

> Phil,
>
> Class objects should validate themselves - they shouldn't have to rely on
> outside code. So in your case I would suggest validating in the user
> class.
>
> Also, beware - your "validation" class is probably not an appropriate
> class. Does it have its own members (which aren't members of other
> classes)? Or is it just validating some other class? If the former, it
> would be a valid class. However, it's easy to fall into a trap of the
> latter. In that case it should be a method, not an object.
>
> It's easy to get confused, especially when you get something like
> "validate" (a verb) and "validation" (a noun). One is a method, one is a
> classes.
>
> And btw - "display" is even worse! :-)

Jerry

Many thanks for your thoughts. You make some interesting points and I hadn't
considered taking that approach of validating within the user class or the
form class.

Cheers

Phil

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация