Information générale
Catégorie:
The Mere Mortals Framework
I'm sitting here trying to model some behavior, and I'm realizing I don't know what I would guess is a fundamental concept for MM: Deleting child records of a parent business object.
I'm finding that I'm adding so much functionality to the base MM classes, that I have to question my methodology. So I'm asking for other ideas.
Here's what I'm doing: I came to the realization that I'm going to need to perform child operations for many things, not just deletions. So I added a method to my subclass of kBizObj called doevent() (this is all just in UML - haven't tried it out yet). I also created a new property, aChildrenBizObj, which is a collection of children which can be associated with this bizobj. So if I call this.doevent('deletechildren'), it will run through all the children in the aChildrenBizObj collection and call their deletechildren() methods.
I looked into using event objects, but it seemed best to keep it in the business object, to centralize control.
Is this nuts? Is there an easier way to do it?
I know I could use referential integrity, but I'm trying to centralize all rules in code, to facilitate future upsizing to other backends. And besides, as I said above, there are so many other things that I'm going to want to apply to all children.
Any thoughts or suggestions?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement