On 6/22/11 7:00 AM, Ed Leafe wrote: > On Jun 22, 2011, at 9:47 AM, Paul McNett wrote: > >> Yes, but what about putting a property in the bizobj, like ParentDeleteLogic, >> defaulting to None, which means to go with however the Parent's >> deleteChildLogic is set. > > Hmmm... not sure I agree with that approach. Children should not make > the rules; parents should. :) > > Less flippantly, child bizobjs are 'dependent', and while I know that > there are some places where we have child bizobj props overriding parents > (even some places that I coded), I think that that was a poor choice and more > of a band-aid than a proper solution.
Okay, you convinced me. I agree completely. If you notice I was wanting to set this from the parent (by passing the property to the child's constructor) and didn't consider the big picture. > >> And, what about propertyizing these attributes while we are at it? >> >> This way, I could do: >> >> """ >> self.bizShapeEffect = ShapeEffect(app.dbConnection, >> ParentDeleteLogic=kons.REFINTEG_IGNORE) >> >> self.addChild(self.BizShapeEffect) >> """ > > > If you want to set it directly, I think it is cleaner to add options to > addChild() - remember, 99.9% of the time this will never be needed, so the > simpler the better: > > self.addChild(self.BizShapeEffect, deleteLogic=kons.REFINTEG_IGNORE) > > This would only require changing addChild to accept optional > 'deleteLogic', 'insertLogic' and 'updateLogic' parameters. If they are > passed, the appropriate dict in the parent is updated to reflect that; > otherwise, the defaults are used. I like it! Paul _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev Searchable Archives: http://leafe.com/archives/search/dabo-dev This message: http://leafe.com/archives/byMID/[email protected]
