Re: Big tidy up of Validation
Franck Routier <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <1217320880.7644.7.camel@franck-laptop> |
Hi Anthony,
Validator factory : the purpose was to avoid creating zillion objects
("Flyweight pattern") doing the same thing. For example, if I have 3000
records with 10 not null fields each, having 30000 SValidatorNotNull
that are exactily the same with no state is a bit silly. But maybe it's
no big deal ? I'm not an expert in JVM internals.
Having auto validation for max size and not null makes it possible to:
-get an early check, for example while in the dataset, ie not connected
-get a consistent and potentially richer exception handling (with
error / field mapping, ...). Resorting to jdbc exception is a real pain.
That said, it does not NEED to be default behaviour and we could ask the
user/developper to explicitely add these validators, but this makes the
code clumsy and / or open for inconsitencies.
So I like the default behavour better but could live without it.
Franck
Le mardi 29 juillet 2008 à 18:07 +1000, Anthony Berglas a écrit :
> I have gone over the code, added some test cases, got SEnum to work
> properly, purged the validation factory etc.
>
> Have a look. More testing could be performed.
>
> Not so sure about auto validations for max size, not null etc. I
> have got them to work properly given that Franck wrote them, but
> maybe this is best left to the database?
>
> Please review, all comments welcome.
>
> Anthony
>
> Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
> Just because it is possible to push twigs along the ground with ones
> nose
> does not necessarily mean that is the best way to collect firewood.
>
>
>
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/SimpleORM/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/SimpleORM/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/