Re: Thoughts from ADO
Noel Grandin <[email protected]> Fri, 26 Nov 2010 10:33:43 +0200
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
--------------060709090603040307010005
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Franck Routier wrote:
>
>
> While we are on new ideas, I'm missing a feature in current Simpleorm,
> related to data validation.
> Currently we can valide a field, or a record.
> But there is no easy way to validate coherence between different
> records.
> For example I can handle the fact that a field must be a date, or a date
> after 01/01/2000, with SValidator. I can check on the record level that
> the beginning date is before the end date of the record, with
> onValidateRecord(). But I have no way to check that two record won't
> have overlapping periods before committing... (well, no way native to
> Simpleorm).
>
>
I think there are some things you are just going to have to handle at a higher level, and this is one of them.
I've seen frameworks where this is possible, but the downside is that performance becomes very non-obvious, because the
framework has to query the database in order to perform cross-record validation.
On the other hand, you could always override doValidateRecord() and do your extra validation there?
-- Noel
Disclaimer: http://www.peralex.com/disclaimer.html
--------------060709090603040307010005
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<head>
<style type="text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Franck Routier wrote:
<blockquote cite="mid:1290706940.13363.20.camel@franck-laptop"
type="cite"> <span style="display: none;"> </span>
<div id="ygrp-text">
<p>While we are on new ideas, I'm missing a feature in
current Simpleorm,<br>
related to data validation.<br>
Currently we can valide a field, or a record.<br>
But there is no easy way to validate coherence between
different<br>
records.<br>
For example I can handle the fact that a field must be a
date, or a date<br>
after 01/01/2000, with SValidator. I can check on the
record level that<br>
the beginning date is before the end date of the record,
with<br>
onValidateRecord(). But I have no way to check that two
record won't<br>
have overlapping periods before committing... (well, no
way native to<br>
Simpleorm).<br>
<br>
</p>
</div>
</div>
</div>
<br>
</blockquote>
<br>
I think there are some things you are just going to have to handle
at a higher level, and this is one of them. <br>
I've seen frameworks where this is possible, but the downside is
that performance becomes very non-obvious, because the framework has
to query the database in order to perform cross-record validation.<br>
<br>
On the other hand, you could always override doValidateRecord() and
do your extra validation there?<br>
<br>
-- Noel<br>
<br>
<br><br><br><hr><font size="-2" color=808080>Disclaimer: <a href="http://www.peralex.com/disclaimer.html">http://www.peralex.com/disclaimer.html</a><br><br>
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width="1" style="color: white; clear: both;"/>__._,_.___</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<img src="http://geo.yahoo.com/serv?s=97476590/grpId=7360226/grpspId=1705006905/msgId=1992/stime=1290760488" width="1" height="1"> <br>
<!-- |**|end egp html banner|**| -->
<!-- |**|begin egp html banner|**| -->
<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px solid #666; padding: 5px 0;" >
Your email settings: Individual Email|Traditional <br>
<a href="http://groups.yahoo.com/group/SimpleORM/join;_ylc=X3oDMTJmb290ZDlyBF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyOTA3NjA0ODg-">Change settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:[email protected]?subject=Email Delivery: Digest">Switch delivery to Daily Digest</a> | <a href = "mailto:[email protected]?subject=Change Delivery Format: Fully Featured">Switch to Fully Featured</a> <br>
<a href="http://groups.yahoo.com/group/SimpleORM;_ylc=X3oDMTJkNXJmb2w0BF9TAzk3NDc2NTkwBGdycElkAzczNjAyMjYEZ3Jwc3BJZAMxNzA1MDA2OTA1BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjkwNzYwNDg4">
Visit Your Group
</a> |
<a href="http://docs.yahoo.com/info/terms/">
Yahoo! Groups Terms of Use
</a> |
<a href="mailto:[email protected]?subject=Unsubscribe">
Unsubscribe
</a>
<br>
</div>
<br>
<!-- |**|end egp html banner|**| -->
<div style="color: white; clear: both;"/>__,_._,___</div>
</body>
</html>
--------------060709090603040307010005--