Winston Gutkowski wrote:Now onto adoptions...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Sangel Kapoor wrote:Only difference I have seen so far is with that "Event design" thing. That model might be helpful if it is easy to find particular event associated with person.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
I haven't thought that part through completely yet, but it feels interesting; and I'm very happy that nothing seems to be "smelling" yet.![]()
SCJP
Visit my download page
Junilu Lacar wrote:That Adoptee thing actually smells a little bit. It violates the Open-Closed Principle, specifically the adoptions field in FamilyTree.
And it seems out of place in the FamilyTree class.
On the other hand, if you think back to Dave's Event model, an Adoption would be a life event...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Randall Twede wrote:I did this same thing when i learned C++. I wrote the a abstract class human. And inherited.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
[To give a concrete example of that generation gap issue, let's say you call addRelationship(joe, grandson, peter). First of all, it's not very clear how to read this: is Joe the grandfather or grandson? Before you answer that, again that's the point. Somebody needs to tell you or you have to go look at the documentation and if there is none, you have to dig through the source code. This design makes the API ambiguous and unintuitive. This could be read as either "Joe is the grandson of Peter" or "Joe's grandson is Peter."
So, with just that one call you have created a generation gap because no intermediate relationship has been defined. Where is the grandparent's child who is the parent of the grandchild? That is, if Joe is the grandfather, then where is Joe's child who is Peter's parent?
Sangel Kapoor wrote:
1. addRelationship(joe, grandson, peter). If it is creating confusion then Math.pow(a,b) is also a confusion but it is still there in JAVA API . Of-course you need to read documentation to use any API or you should use microtypes to avoid it as much as possible. What about Account.transfer(Account acc1, Account acc2), same problem.
You can add another parameter called Direction which I thought of but I thought its not required as of now. We can change this to addRelationshipFor() or can use Microtypes as Parameters to resolve this further though. For instance
addRelationship(Source person, Relationship, Target person). I think that is more of clean-coding issue rather than API signature issue.
Winston Gutkowski wrote:
Not too bad, but I think it can be improved. We now have two different types of Child, one biological, the other not, so the second one has no biological linkage. But what if we add that to our interface? Viz:Now the next two become:and now our two "groups" (people/children and adoptees/adoptions) start to look quite generic.
Junilu Lacar wrote:It took me a while but I finally realized what was smelly to me about this. Actually, since it wasn't very obvious at first glance, there are two smells:
1. It's confusing and hides a design flaw
2. The relationship between Child and Individual, as defined, is not right.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
2. The relationship between Child and Individual, as defined, is not right.
There I don't agree, although I understand your point about "incest".
The fact is that ALL the following statements are true:
1. Every person is a "child" - ie, someone with "parents".
2. Every person is also a biological child, even if one or both biological parents are unknown.
3. Some people are ALSO adoptees, which defines a legal child - ie, someone with legal parents.
Junilu Lacar wrote:While all those statements are true in the real world, Individual implements Child implies that "Not every Child is an Individual", which is true in the context of the software design but it is also in direct conflict with the statement that "Every Child is an Individual" in the real-world context.
The conflict between real-world semantics and software design semantics is what makes it "not right", IMO. The two need to be aligned so that there's no cognitive dissonance.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Child can be documented - for "those who need to know" - to explain that, for the purposes of a family tree, every Child IS an Individual.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:after nearly 140 posts in which each has highlighted the superiority of his design, compared to the rubbish of the others
, why not put the ideas to the test? Say, before June 1st, send your FamilyTree (or whatever) to OP, complete with instructions, let him/her apply it to whatever he/she has, and then let OP decide the winner.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:I think you may have found a better way to look at this. Parent, Child, Adoptee, Husband, Wife, Spouse/Partner, etc. are all Roles that the same person can take on.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Piet Souris wrote:
after nearly 140 posts in which each has highlighted the superiority of his design, compared to the rubbish of the others, why not put the ideas to the test?
Say, before June 1st, send your FamilyTree (or whatever) to OP, complete with instructions, let him/her apply it to whatever he/she has, and then let OP decide the winner.
Winston Gutkowski wrote:
Junilu Lacar wrote:I think you may have found a better way to look at this. Parent, Child, Adoptee, Husband, Wife, Spouse/Partner, etc. are all Roles that the same person can take on.
Me? I thought it was you. I've tried to be as minimalist as I can all through this.![]()
Piet Souris wrote:Why not put the ideas to the test?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Happily living in the valley of the dried frogs with a few tiny ads.
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|