View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Spring 2004 Milestone 1

please add new questions to the top, its easier to notice them that way.


Will we be expected to validate the user entered data so it conforms to the GEDCOM Data Representation Grammar? Or is this not a requirement of M1? #28

Not for M1. Chris Verges



Is there some example SUnit code we could look at somewhere? I must be looking in the wrong places, but I'm not seeing any. Matt Balaun

i think you just came to see me, but for other people looking for help, try some of the turnins from previous semesters. this group, for example, has all of their code up on the cases page: bears with lightsabers once you file it in to squeak, you will see classes with names like <regularclassname>Test, this is where all of their SUnit code will be. -ellie

there also is supposed to be a tutorial on squeakmap. you can download squeakmap for the first time by leftclicking anywhere to bring up the world menu, then select open, then select package loader. however, i have been unable to get squeakmap to work at all, so i don't know how useful that will be. i'm on a mac right now in the coc, i've tried 3.5, 3.6, and 3.7(beta) versions of squeak. other people might have better luck on windows/linux? not sure... -ellie



Can a person belong to more than one family as a spouse or child? That is, can a person have more than one FAMC tag and more than one FAMS tag? Uri Mandelbaum

a person may belong to more than one family as a spouse, but not as a child. since we're mapping genealogy, we only put children in their biological families -ellie



Do we need to specifically have the date of the form <dd> <three letter abbreviation for month> <yyyy>? Or is it okay to use the default printString for the Date class? Seth Horrigan

i assume you mean for writing the GEDCOM file. you'll need to use the GEDCOM standard, which as i understand it is dd MMM yyyy, so that your program writes standard-compliant files that can be read by other programs. you can edit the printString method, or create a new method in the Date class if you like, just make sure you turn in that code to your ta. -ellie

Actually if you look in the Date class there is a printFormat: method that takes in a literal array. To get the GEDCOM standard you can use
 (<Date object> printFormat: #(1 2 3 $ 2 1 2)) asUppercase 
to get the GEDCOM standard format for the date as a string. If you are interested in how the array is formed and what each entry does look at printOn: format: which uses a format array as well. This will probably be easier than actually writing your own method in Date. -Chris Wells

thanks chris, that is a wonderful suggestion -ellie



When we are making our GEDCOM files, and there is a person who does not have one of the standard fields, what do we do?

E.G. There is a person with no gender set, do we have a tag:
"1 SEX"? Or do we just leave the "SEX" tag off altogether? Also, what if they have a given name but no surname, or vice versa? Seth Horrigan

you may handle this in any way you see fit. leaving off the tags i think will be ok, but make sure that other programs still read in the file correctly. i'm not sure if some tags are considered "essential" by the GEDCOM standard (but i don't think they are - incomplete information is a common problem in family histories). if for some strange reason, some tags are considered "essential," writing something like "no name" would also be acceptable. just document it to your ta please :) -ellie

What other programs should we be trying to read it into?

the ones on the assignment page. see requirement number 3. -ellie



TA assignments have been made as follows. See the turnin coweb for more information.

TA(students' last names)
Ellie Harmon(Armstrong - Davenport)
Randy Rockinson(Day - Hernandez)
Jonathan D'Andries(Horrigan - Myhrberg)
Chris Hunt(Natkovich - Stroup)
Chris Verges(Syfert - Yap)

note that these pairings are temporary for the individual milestone (M1) only. you will get a new TA once you form groups for M2-M7. he/she will then be your group's TA for the rest of the semester.



Should we hold a location for a divorce or just a date?
Also, is there a way to store references to an object rather than the object itself, so that if the object changes, all the places it was stored will be updated as well? Uri Mandelbaum

just a date: f divorceDate: (Date newDay: 29 month: 9 year: 1989). in real life, divorces don't really have important/significant locations. marriages, however, do. that's why we store different information for each one.-ellie



Okay a few questions...

First, how do I do a class constructor in Squeak? I assume it doesn't have one... great. So I could overload new as a class instance, but then my instance variables go out of scope....

Second, what is wrong with this (I'm trying this in the Workspace)

l := LinkedList new.
l add: 'Test'.
l add: 'Test2'.

The first add goes by fine, but the second gives the error:
String(Ojbect)>>>doesNotUnderstand: #nextLink:
LinkedList>>addLast:
LinkedList>>add:

I miss java already

Squeak dosen't handle LinkedLists like you may be used to. As you may have noticed from the error message, elements added to a LinkedList must be of a particular class (in this case, Link). Using a browser, run a search for the Link class to see how it is structured; it is essentially an abstract class. You would have to subclass Link in order to create a node that could hold information. I just now created a simple StringLink class with an instance variable 'contents'. These StringLinks can then be added to a LinkedList with no problems. But LinkedLists are probably unnecessary for our purposes in Squeak at the moment. Try looking into the various sorts of collections. Consider Bags for unordered collections and OrderedCollections for, well, ordered collections. These are just suggestions; many of the collection types have specific behaviors. Make sure to read the class comments (the '?'). Chris Hunt

w.r.t. the constructors, you can create class methods by selecting the class button. instance methods are what you are creating by default when the instance button is selected. you typically use the class method new to create a new object, and the instance method initialize to initialize variables in the new instance of the class created. you might look through the joe the box case-study, esp. section 3.4 in the book, or the slides for class tomorrow (jan.20) for an example. also, chris verges put a nice example of new/initialize methods on the newsgroup under the subject: String Concatenation & Variable Initialization

w.r.t. collections, you might look at the slides from jan. 8. -ellie



Do we have to implement the FAMC and FAMS tags in Person? (these are the pointers back to the Families the Person is a part of) Adam Edwards

i believe so. -ellie

oh my, i have just now come to understand your question correctly (i think). you don't neccessarily have to implement these tags in the Person class, if that is what you are asking. any way you want to keep track of who belongs to what family within your program is up to you. i thought you mean for exporting GEDCOM files in which case, you'd need both of those tags somewhere in the file. -ellie



So lets say you have a Geneology class with structures in it to keep track of Persons and Families. So then it would make sense that every time a Person and Family class instance was created, it gets appropriately added in the Geneology class. This would require an instance of the Geneology class but how would the instances of Person and Family know about the Geneology instance so it could add itself to the appropriate structures? Or how would the Geneology instance know that Person and Family instances were created so it could add them to its structures? You could just pass in the Geneology instance when creating a Person or Family class but then this would be incomplete: p := Person new Thanks. -David

ok, suggestions.
  • yes, one way to do it is to pass a Genealogy instance to the new method when creating a Person/Family. it is ok for you to modify the new method to be something like p := Person new:aGenealogy..
  • another way to do it, is to have instance methods in the Genealogy class so that Person new or Family new is called indirectly from within this method. so the user might type something like. g := Genealogy new. p:= g addPerson. where the addPerson method returns a Person p created with Person new., and that has already been added to the Genealogy g.
  • another way would be to use a class variable in the person and family class to register an instance of the genealogy class to which all new person and family objects should be added
  • and one more way would be to create people/families with the already established p := Person new. or f := Family new. and then require the user to add each Person/Family to the genealogy class after the fact (something like g := Genealogy new. g addPerson: p. g addFamily: f.
-ellie

there are a couple of ways to do this... tentatively, i'll say that we're lenient on things that we don't specify outright. we'd like to see what you think would be a good design for solving this problem. any way that makes sense to you for keeping track of this information is probably ok as long as you document it in a README file so that the ta who grades your assignment will know how to use your program. i may post some specific suggestions after i talk to the other tas - check back tomorrow. -ellie

ok, i think we're going to leave it as a design issue for you guys to figure out. so any way you want to handle the genealogy/family and genealogy/person relationships is ok. you can add new methods or alter the ones we require, just make sure you explain it to your ta so that he/she can grade your program correctly. if you're really stumped/concerned then come visit one of us during office hours this week - we like company :) -ellie



For our person class, should we be keeping track of maiden names for women in the family tree? John Lyon

you need to keep track of exactly information is specified about a person. if i say
wife _ Person new.
husband _ Person new.
wife surname: 'Smith'.
husband surname: 'Williams'.
you don't change the name of the wife to match the husband if that's what you're asking. and, you don't need to deal with name changes either, if that's what you're asking. so if i later say
wife surname: 'Williams'.
you don't need to keep a history of her previous name. -ellie



"Note that these can occur in any order and that the information about a person may be incomplete."
So if you just wanted to edit the location of birth, how would you distinguish it from the location of death? -David

all we mean is that methods may be called in any order. if you notice, there are 2 separate methods to distinguish between birth and death.: p born: (Date newDay: 15 month: 9 year: 1909) location: 'Detroit, Michigan, USA'. and q died: (Date newDay: 29 month: 1 year: 1915) location: 'Unknown'. born:location: is a single method taking 2 parameters, and died:location: is a separate single method also taking 2 parameters. there is no special method to set the location of birth/death separate from the date of birth/death. you must simply use the method born:location: passing as one parameter the string 'Unknown'.-ellie



for those of you who haven't checked it out already, there is some good information in last semesters' projects (a tutorial/guide for squeak) on the cases page about getting started, how to do things in squeak, etc.



The grading sections says:

What code are we supposed to be reusing? I have found a wealth of advice on the cases pages, but not much in the way of code. From where should we be drawing this code to reuse?

Is there somewhere that we can find examples of "good comments"?
Seth Horrigan

From inside Squeak, for one. From Squeakmap, for another. But you will also generate code over the course of this semester ... feel free to release that to the public at large (GPL or LGPL or whatever). As far as examples of good comments, things like "This function does something" would NOT be a good comment. Explaining more would be nice: "This function takes in a String and changes all the characters from uppercase to lowercase, as needed. If the input is not a string, it attempts to get the asStringOrText representation and then perform the same function. If the input does not support that method, then it returns nil." Many more words, much better explanation. You could even spread that out throughout the code if you have a more complex function where the TA might not be able to follow it at a glance. (We do look at code you submit, so make sure it looks nice and is readable or we cannot give you proper points. Chris Verges

another important part of having "good comments" is to have class comments. these go in the ? section of a class (you know when you select a class there are three buttons, class, ?, and instance... class and instance are where respective methods are declared, but the ? section is special just for comments. there is already a template there for you to sortof fill in. -ellie



"Gender: p isMale. q isFemale. (Let's not deal with changes in gender in a lifetime.)"

I'm a little confused by this part. Are isMale and isFemale accessors or modifiers? And if they are accessors, how is the information set in the first place?
Thanks, Andrew Guillory

Generally in programming, the convention is that accessors and modifers are either (a) the variable name [like in Squeak] or (b) functions that begin with the phrase get or set. Things that start with the phrase is usually return boolean values. So ... p isMale should return true if the person represented by p is a Male. (Continue for isFemale and q as needed.) Chris Verges

acutally the assignment is a bit confusing in the instructions due to said conventions. these methods are actually supposed to be modifiers. therefore sally isMale. (assuming sally := Person new.) should set sally's gender to male. to match with conventions, it would make more sense to say something like sally gender: male.. or sally gender: female. to set the value and have sally gender. return either male or female. i will talk to prof. leblanc at the ta meeting tomorrow, and try to clear this up a bit. sorry for the confusion. -ellie

ok, the requirements for milestone one have been altered as follows: Gender: p gender:#male. q gender:#female. (Let's not deal with changes in gender in a lifetime.) -ellie

what do you mean by "#male"? are 'male' and 'female' 2 classes that we have to create? or did I understand it incorrectly? Thanx -bugs

# is the prefix for a symbol; #male and #female are symbols. -Toby Butzon



Posted this on the newsgroup, but here is probably a better place:

"You are to create the ability to export your genealogical data from your tool and demonstrate that your output meets the standard by using it with a freely available GEDCOM-reading too"

Does this mean that for the moment each instance of Family and Person should be able to export itself, or are we to create a preliminary geneology tree to hold our instances and then be able to export that to GEDCOM?
Thanks, Peck

you need to be able to export the data about every person in a family to a single file. one way to do it, might be to build a geneology "tree" that holds all of the instances & then export the family tree to a file as you suggest. -ellie

i was wrong here. a GEDCOM file can contain multiple families. so you'd need to write to the file every family thats currently available. so, you probably want to stay away from trying to make a family tree. look at an example GEDCOM file to see how the layout works, then you will understand better how to file out your data properly. also, prof. leblanc will be discussing this in detail today (tuesday) in class, i'd encourage you to go and hear what he has to say.-ellie



lets say.. we create 3 'persons' and add 2 of them to a family. While creating the file, is the data of the 3rd person also included in the GEDCOM file?
thanx - bugs

yes. the GEDCOM file should contain all of the data entered. -ellie



Does anybody know if there is any software that will run on GNU/Linux for checking our GEDCOM records? - Andrew Sayman

Not specifically, however there are Java-based clients that will run on any platforms supported by the JVM. So in that sense, yes there is software. A quick google search yielded several GEDCOM programs for Linux, so I suggest trying there. :-) Chris Verges

After the users/graders of the program have entered all the data they desire and decide they want to write the info to the GEDCOM file, how will they invoke this action? (i.e. send writeToFile to some object?). Also, is there a preference to what the output file should be called or is .ged ok?

Thanks, Dan

Good point about the saving of gedcom files ... it just got e-mailed to the TA list. Hopefully we'll have more back for you on that by Thursday at class time. As far as the extension on the gedcom files, IF we are to give you a filename (that will depend on the previous issue), assume it will already have .GED appended. You don't have to worry about parsing that string and checking it. Chris Verges

with regards to exporting: basically you need a way to 1. keep track of all of the people/families that are entered and 2. to export all of this information. there are 2 basic options. you can either 1. use class variables and methods in the Person and/or Family classes to keep track of all of this information, OR you can 2. implement a 3rd class, say Genealogy that holds a collection of Person objects and a collection of Family objects. it can have methods to load and save the data, and to find certain people/families. (note that you only have to export data for M1, but more functionality will be added later, and the creation of a Genealogy class might facilitate improvements/additions to your code.) personally, i find that the second option is a little easier to implement, but we're leaving this design/implementation decision up to you guys for M1. you'll just need to let your ta know how you implemented it - and tell them what line(s) of code they can execute in a workspace to export all of the person and family data they have entered to a single file. -ellie

with regards to file name: this doesn't matter. you can decide the name as the programmer, or you could let the user specify the name themselves. if you decide the name, it would be nice if it were something meaningful, ie. grab the oldest person in the set of data, and use their last name, or something.... but thats not a requirement of course. just let the TA know the details in a short readme file you turnin with your code. -ellie

Link to this Page