Well, but you do have invalid entities persisted, right? That is my point.
It can happen…Now, you have several options for fixing this. In some naive
scenarios, you could probably pad the numbers with zero, but in most cases
you’ll need to  load the invalid entities for being corrected in your app’s
UI.
 
So, even though you perform validation before saving entities, you can still
have invalid entities on the database (btw, to me an invalid entity is one
that doesn’t comply to a predefined set of rules).
 
--
Luis Abreu
 
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Ayende Rahien
Sent: sábado, 25 de Outubro de 2008 21:41
To: [email protected]
Subject: [nhusers] Re: Calling constructor that performs guard checks -
immutable types
 
At this point, the DB is broken, you can't change the app before you fix the
data.
On Sat, Oct 25, 2008 at 10:31 PM, Luis Abreu <[EMAIL PROTECTED]> wrote:
Oh no? And then how do you solve those cases? Lets suppose you've got a
property called Something on object X and you say it must have no less than
3 digits. You've already persisted 1000 objects when you receive a report
saying that now Something must have no more than 10 chars and that all
digits must be bigger than 5. Aren't those 1000 objects in an invalid state?
I'd say yes, they are and yes this is  a common situation that affects many
real apps…
 
--
Luis Abreu
 
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Fabio Maulo
Sent: sábado, 25 de Outubro de 2008 18:56

To: [email protected]
Subject: [nhusers] Re: Calling constructor that performs guard checks -
immutable types
 
I don't have persisted invalid entity instances even when I change a
validation constraint.
2008/10/25 Luis Abreu <[EMAIL PROTECTED]>
Yes, you can end up having persisted objects with invalid state. How?
Simple, just think  about what happens when one of your validation rules
changes after your app is on production…this is an interesting topic which
has also been discussed on the altnet list…
 
--
Luis Abreu
 
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Will Shaver
Sent: sábado, 25 de Outubro de 2008 17:08
To: [email protected]
Subject: [nhusers] Re: Calling constructor that performs guard checks -
immutable types
 
I believe this has been discussed in the past, please search the group
archives. While I believe there are solutions involving custom object
loaders, why would you have an invalid object in your database?
On Oct 25, 2008 4:17 AM, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:

Repeated request.
Our friend bstack is something impatient.
2008/10/22 bstack <[EMAIL PROTECTED]>
> > > All, > > We are using immutable types in our domain, that we want to
map > directly to to dat...



-- 
Fabio Maulo
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.1/1732 - Release Date: 22-10-2008
07:23
 
 



-- 
Fabio Maulo
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.1/1732 - Release Date: 22-10-2008
07:23
 
 
 

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.1/1732 - Release Date: 22-10-2008
07:23

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to