[SQLObject] Sobject and validating via schema objects.
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: David D. <cou...@gm...> - 2005-05-12 17:29:58
|
I am trying to figure out the best way to organize this. I have a sqlobject "Customer" and a validator schema CustomerSchema. I want the application to be able to use sqlobject directly so I don't have to do anything to wrap up the object traversal. Java programming would wrap sqlobject with another object that contains the domain logic and getters+setters etc to get some seperation between the application and the persistence object. Since I want the application to use the sqlobject directly I need to decide on how to interject validation and other DO logic. What I am looking at now is an object that be something like "CustomerUpdater." This would receive the object that needs to be updated and a dictionary that maps keys to new values. This would be called by the application. The updater would pass values from the updated dictionary and values in the sqlobject to the validator schema doing field level validation then doing chain validation. If everything validates update the sqlobject. If it doesn't return a dictionary or list of fields that didn't validate and the sqlobject remains unchanged. I have drawn this on the whiteboard several times and this is the closest that I can get to making sense out of what I want to do. Does it make sense to anyone else? --=20 *********************************** See there, that wasn't so bad. *********************************** |