The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I'd probably think about this a bit more before jumping immediately to the idea of copying the whole entity for every "trial edit".
First you really need to get some idea of how often "good" edits are likely to occur compared with "bad" ones. If there are many more "good" ones I suggest you don't want to burden all those good ones with unneeded extra copying.
Any of these sound likely?
if validation fails, just throw away the entity and reload when necessary from the stored version.
If there is cross-field editing too complex for that
can you make a "form" object to hold all the data for one update and validate the form before you start touching the real entity
Does that make any more sense?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
If the entity is valid, great, however if it is invalid I've now dirtied my entity when I didn't want to.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
What bad thing happens because of a dirty entity? If it's shared among users one user could mess others up.
But if it belongs to one user's session, maybe it's ok. Maybe a user can hold an invalid state and work on it until it's clean or they abandon it, but they can't save an invalid state to the database.
... referenced from multiple places in the application ...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
... referenced from multiple places in the application ...
That might be something to talk about, too
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Frank Carver:
I guess the real challenge is whether between us we can come up with a general solution to this (perhaps using automatic proxying) which will simply wrap such a transaction around any object. Anyone want to try it?
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |