Junilu Lacar wrote:Parent is a role, as is son, brother, sister, cousin, etc.
One person can have multiple roles depending on the context, just as you are half-brother, son, and stepson to different people.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Dave Tolls wrote:From what I can remember of how these things tend to be structured, most data structures for genealogy use events rather than direct relationships.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Dave Tolls wrote:I've seen simple things like remarriages being a pain in some freebie genealogy software (for example), resulting in a step-parent who has no kids simply not appearing in the tree, which seems an odd thing to do. They may not be part of the DNA line, but that's no reason to have them vanish from the picture like some Stalinist bit of photo-editing...
Stephan van Hulst wrote:I think this also has to do with the difference between "Family" and "Blood". Do you include adopted children, etc.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Aaah. Now THAT makes a lot of sense. Cheers Dave. Have cow too.
Winston
Junilu Lacar wrote:Foundational relationship is biological parent-child. This is an irrevocable and absolute relationship. Use a non-binary tree to represent this. Trees will be very simple, just parent-children. Person know two biological trees: the one where he/she is a child and the other in which he/she is a parent. Tree nodes can represent one or two people.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:And in the meantime, I like Dave's event model..
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:I disagree however, that it's absolute (at least in database terms).
Dave Tolls wrote:From what I can remember of how these things tend to be structured, most data structures for genealogy use events rather than direct relationships.
So you have a Person, which is the basic data (usually just name, gender, that sort of thing). Their status relative to other people (and some of their own data) is handled by events, including things like 'birth', 'death', 'marriage', 'divorce', 'adoption'.
IIRC (and this is a bit hazy) a relationship then is defined by these events.
Who are your parents? Look up your birth event and see who's tagged in there.
Are you alive? See if there's a death event...though I think there might be a 'probably dead' flag on a person, not sure.
Just throwing that out there to give an idea of how some of these things have been modelled.
Sangel Kapoor wrote:"marriage, adoption," Is this relationship ?? I feel SPOUSE and CHILDREN or ADOPTED-CHILDREN is relationship
Sangel Kapoor wrote:
7. Coming over to "FamilyTree Registrar" . Thoughts are like : You hold your Passport and go to Passport office officials for VISA STAMP. 2 things to mark
1. You HOLD passport.
2. You go to PASS PORT office who has the right to mark VISA stamp on it. You go to UPDATE your Passport.
Similarly ....
1. Person HOLD FamilyTree ADT.
2. Person will go to FamilyTree Registrar to UPDATE his Family Tree.
...
Given above specs my program is running perfectly.
I find that a very strange way to think .
I just don't think it would make a whole lot of sense to many people.
Sangel Kapoor wrote:
Junilu Lacar wrote:I think you're using "absolute" in a different context from what I had in mind. I meant it in the sense of "absolute vs. relative".
If I have many small Parent-Child trees, then the relationship between parent(s) and child will be inherent in the tree structure; it is absolute.
All other relationships can be inferred from this.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
If I have many small Parent-Child trees, then the relationship between parent(s) and child will be inherent in the tree structure; it is absolute.
Yes, but as I said above, not everybody will fit into that kind of "tree" concept, since not everybody has children.
Junilu Lacar wrote:No, but everyone is a child. The degenerate cases are pretty easy to handle. A childless couple is simply a tree with a null set of child nodes.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Note that this is ONLY for biological relationships. Things like marriage, spouse and adoption are legal ones, which I suspect are better covered by an event model (which could also allow you to supply supporting documentation). Indeed there's no reason that some of the information included above is also contained in the event model (eg, Births and Deaths).
The advantage of separation of concerns is that you won't have to worry too much about affecting the success scenario code if you needed to add validation criteria. You'd simply modify and retest the input validation method and related scenarios. Conversely, if you had to change the success scenario logic, you can do that independently of the input validation logic and not have to worry too much about breaking that part.
Winston Gutkowski wrote:
Junilu Lacar wrote:No, but everyone is a child. The degenerate cases are pretty easy to handle. A childless couple is simply a tree with a null set of child nodes.
Yes, but that's not modelling what you initially said, which is that every person is a child. A tree with no nodes, to me, is saying that everyone is an "optional" parent.
Winston Gutkowski wrote:If your model accurately depicts the Hapsburg family tree - which has hundreds of members, most of whom are very well documented since they ruled half of Europe at one time - you're onto a winner.
Sangel Kapoor wrote:
Still, how would you do that in my case, the line for finding the reverse relationship throws an exception.
Junilu Lacar wrote:It seems to me that you're stuck looking at just one perspective.
Each of the individuals who make up a childless couple are part of a Parent node that has a null set of child nodes.
Each of them in turn is part of another tree where they are represented as the child of their own parents.
It goes back to that Role archetype I mentioned. You're always a Child and optionally, you can be a Parent.
And the reason I call Parent-Child relationship foundational and inherent is because you can always tell from looking at a Tree whether a Person in that tree has the role of parent or child. Once a person gets married or "shacks up" with another person, he/she gets put into the Parent node of another tree with his/her other half, thus completing the couple that occupies that parent node.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Ah, but to me that's premature. Just because you marry, or get "shacked up" with someone has nothing to do with whether you're a parent or not. The only determining factor of "parenthood" in my model is whether you have a kid or not - ie, children.keySet() returns a list of all "parents".
Winston Gutkowski wrote:
Junilu Lacar wrote:It seems to me that you're stuck looking at just one perspective.
Funny. I was going to say the same thing.
Junilu Lacar wrote:Being a couple makes the questions like "Did Bill and Sue ever have any kids?" applicable and easy to answer. You just find the parent node that represents the couple "Bill & Sue" and see if there are any child nodes.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:No, I see where you're going with your scheme. It just seems like you're looking at my scheme with the same lens that you're using to view yours.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:I'm looking at the Tree concept somewhat like an Iterator, as an abstraction and a "lens" to an underlying set of data. It's from the idea that Campbell gave about a Person having two trees, one for parents, another one for offspring...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:I suspect we're not really that far off from each other, you know. I've just made my Individual the "child" and implemented my "parent" view as a Map.
Just posting this to try to articulate the picture I have in my head.
I'm looking at the Tree concept somewhat like an Iterator, as an abstraction and a "lens" to an underlying set of data. It's from the idea that Campbell gave about a Person having two trees, one for parents, another one for offspring. That's where the idea of using two different "lenses" came where I could go to a Person and ask him for a Tree view where that person has a child role or for others where they are have the parent role, or at least are part of a couple that makes up a Parent node. The Tree would then allow me to access the Parent and Child nodes directly and I can recurse from there. That's why the Role enum, if I found that it was really necessary, would have only Parent, Child, and possibly Sibling but probably not, as its values.
From a Parent or Child node, I can traverse the underlying collection by moving between Child and Parent nodes and invoking a relatively small API (getParentTree(), getChildTree(), getChildren(), getParent(), hasMother(), hasFather(), hasChild()) on the Tree/Node interface. Visitor pattern and the Strategy pattern are already vaguely creeping into the design picture at this point.
As I move from one person to another asking for one Tree view or another, I am able to move from person to person, child to parent and vice versa. This can all be done recursively or iteratively if you don't like recursion. The notion of the Akka-esque Root parent node comes in very handy in stopping the recursive or iterative traversal and of course when a Parent node (representing a couple) has no Child nodes, the recursion stops with the childless couple as well.
Now where Dave's Event idea comes in is that once the biological connections have been made, you can layer on the event-related connections. Say Bill and Sue adopted a child named Jim. Jim gets added to a Child of the "Bill & Sue" Parent node with an "adoption event" marker. Bill cheats on Sue and has a child with Mary so now Bill and Mary become a couple in Parent node with a Child node that represents their love child, Connie.
With the combination of Couple/Parent/Child connections and Event markers, I think I can come up with something that reflects what happens when the guy in the song becomes his own grandpa.
Sangel Kapoor wrote:Am I not doing exactly the same except , I am keeping SPOUSE as extra relationship . You are talking about keeping it in small trees and I am keeping it in HashMap.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Consider Paul's rocket mass heater. |