Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

FinalExam Review Fall2005: Interpret the UML

Questions? Comments? Answers?
(Back to Final Exam Review Fall2005)


I thought we weren't going to get very complicated with the UML diagrams.................??????????

and what does # mean in a UML diagram?

seriously, this really won't be on the test will it? Removed at KS request

I won't ask you to DRAW a complicated UML diagram, but questions like these are fair game. "#" means "Protected" – not public nor private. Mark Guzdial

Yes, everyone shake your head...Tannis is posting answers to this question......
(A)blocked
(B)something something... getFactory() sorry, I think we are all stumped on this UML class diagram
(C)Something to do with DEAgent ??? Not sure
(D)frames
Removed at TB request

A is right. B – trace it out. Presume that all instance variables are public to start with, and don't worry about casting. this.simulation.factory. Now, figure out casting. C. How about this.simulation.agents as a start? D is right. Mark Guzdial

So I meandered over to Guzdial's office today after finishing one of my exams early in hopes to catch him there. I caught him and slapped down the UML and asked if he would help. Needless to say I have the official Mark Guzdial answers. they come as follows: (i'm SUCH a dork)HINT: if you stare at the UML long enough, the answers begin to truely make sense...
a. blocked
b. ((FactorySimulation(this.Simulation)).getFactory()
c. this.Simulation.getAgents()
d. this.frames()
Removed at KS request


So this is like a magic eye picture? i get it now
Kyle DuPont

If you squint really hard and hold the UML diagram about 10 feet away, it vaguely starts to look like Abraham Lincoln. Or maybe that's King REMOVEDng. I forget. Mark Guzdial


Actually, (b) isn't quite right. It's got to be of the form ((CAST)(THING TO CAST)).THINGTOACCESS. So it should be ((FactorySimulation)(this.Simulation)).getFactory() (missing one right paren in Krista's). Mark Guzdial


Why don't you have to cast C as well? Moreover, why is B not this.FactorySimulation.getFactory()?
Kyle DuPont

Good questions, Kyle! In this.simulation.getAgents() (note: simulation not Simulation–you're not referring to the class, you're referring to an instance variable inherited by this), you are access a method getAgents() this is known to Simulation, and that's what the variable simulation is declared as. Does that answer your second question, too, Kyle? There is no instance variable FactorySimulation, so that wouldn't work. Mark Guzdial




Link to this Page