I want to choose a design pattern for the below case: Ancestor Tree: An ancestor tree is a special type of family trees that keeps track of all known ancestors of a person. The following is the data definition of an ancestor tree. • An empty ancestor tree is an ancestor tree.
• A non-empty ancestor tree is an ancestor tree that contains o a String representing the name of a person, o an int representing the year the person was born, o an ancestor tree for the person’s father, and o an ancestor tree for the person’s mother.
Since this looks like a behaviour pattern, will factory pattern be suited for this?
Aucun commentaire:
Enregistrer un commentaire