|
From: G. <fra...@cl...> - 2003-07-04 10:33:28
|
Hi all, I've a new need (arg ;) ) : I've to minimize network traffic : I want to update an SQLObject (or better a collection) once I've modified all the attributes. I know a design pattern from j2ee/ejb : Data Transfert Object (www.theserverside.com provides a free book : "ejb design patterns", which describes DTO on page 47).=20 This pattern says : a SQLObj produces a light object that doesn't update the db each an attribute is set. Once the work with this DTO is done, it would be passed to the SQLObj so the attribute will be updated in the db. So I'm asking about what to do : adding a "passive mode" to SQLObject and add a "save" method to explicitly update, or adding a generated method getSomeClassDTO that would return the DTO.=20 DTO could be implemented as a proxy over SQLObj : reading attribute on DTO will read on SQLObj, but setting attribute will store in a local cache, marking this attribute 'modified' so reading will read this modified value. If you have any idea about this problematic, I would appreciate a lot ;) Fran=E7ois |