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

Spring 2006 Final Exam Review

Due: Last Day of Class
For this CoWeb assignment, you will complete a final exam review. On your Who's Who page, answer one or more of the questions below. You will need to answer enough questions to get you to a total of 4 points. So, you can do the large design question or a combination of smaller questions. The TAs will be grading for effort and the quality of the answers. You should be able to use your fellow classmates' answers to study for the final exam. Make sure that you clearly indicate which question(s) you are answering.

History of Object-Oriented Programming (1 Point)

Pick two of the following four people and briefly describe one of their main contributions to object-oriented programming and design: Kent Beck, Ward Cunningham, Alan Kay, and Ivan Sutherland. (Note: Do not describe more than two.)

Collection Classes (1 Point)

Answer the following questions on the different collection classes available in Squeak.
  1. How do OrderedCollection and Set differ?
  2. How do OrderedCollection and Array differ? Why would you use one over the other?
  3. How do you use a Dictionary? Why is accessing a Dictionary so fast?

Questionnaires (1 Point)

Questionnaires are a common technique for evaluating human-computer interaction. If you were designing a questionaire, what are three things that you need to watch out for to ensure the validity of your findings. Why are each of these a problem? How do you avoid them or keep their influence to a minimum?

Usability (2 Points)

You've learned about three usability evaluation techniques in this class: heuristic evaluation, cognitive walkthrough, and observing users. Compare and contrast two of these. What are the strengths of each approach? What are the weaknesses? When are they appropriate to use? Why would you choose one over the other?

Design Patterns (2 Points)

(Part A) Besides its name, name three characteristics commonly used to describe design patterns. For each characteristic, describe what it is and why it is useful? (Part B) Observer, Adaptor, and Factory are three design patterns described in this class. For two of these three, briefly describe them using the characteristics you chose.

Frameworks (2 Points)

  1. Why are frameworks useful?
  2. What is the difference between a framework and a class library?
  3. List two of the Squeak frameworks covered in this class and what they provide.
  4. Explain two of the reasons that a framework is difficult to develop.

Blocks in Virtual Machines (2 Points)

The following two instance methods on the Number class both compute whether the number (self) is greater than one number and less than another:
Uploaded Image: vm1.png

The following table shows how long it takes for these methods to execute for different numbers:
Uploaded Image: vm2.png

(Part A) Why is it that the first two expressions take the same amount of time to run (0.00143 ms), whereas the last two expressions differ in run time?

The byte codes for the two methods follows:
Uploaded Image: vm3.png

(Part B) Given these byte codes, explain why the block expressions are faster to execute than the parenthesis expressions.

(Part C) In the blockGreaterThan:andLessThan: method, the message and: is sent to the object returned from (self > greaterThan) with an argument of [self < lessThan]. At least, that’s the way the Smalltalk syntax would lead you to believe. In reality (in the byte code), you can see that there is no and: message sent. Why is this so?

Language Features (2 Points)

Squeak is perhaps the least well documented programming language you will ever use; however, Smalltalk and the Morphic GUI compensate for this by being pokable (easy to explore). There are many language features and tools for exploring Squeak. For four of these, name them, describe how you use them, and explain why they are useful.

Object-Oriented Language Design (2 Points)

OO programming languages differ quite a bit in their philosophy, purpose, and implementation. The following five questions ask you to examine some design choices for creating an OO language. Answer only two of the following:
  1. Java, C++, and C# have primitive types. Eiffel, Ruby, and Smalltalk do not. What are the advantages and disadvantages of having primitive types?
  2. C++ and Java are statically typed. Objective-C and Smalltalk are dynamically typed. What are the trade-offs of static and dynamic typing?
  3. Most OO languages run on a virtual machine. Java and Smalltalk do. C++ does not. What are the advantages and disadvantages of using a virtual machine for OO programming?
  4. Smalltalk blocks are closures. They combine a piece of code with a lexical environment. Other OO-languages that have closures are Ruby and Eiffel. Java and C++ do not. What are the advantages of having closures? Why do some languages not have closures?
  5. The inheritance in Java and Smalltalk is class-based. The inheritance in Javascript and Self is prototype-based. What are the advantages and disadvantages of class-based and prototype-based inheritance?

Garbage Collection (3 Points)

(Part A) What are the advantages and disadvantages to using garbage collection? (Part B) Explain how reference counting works. Include an example. (Part C) Explain how mark and sweep works. Include an example. (Part D) What problems of garbage collection do generational scavenging and “stop and copy” address? How do they address them?

Analysis and Design (4 Points)

Design a virtual fish tank. Your virtual fish tank should be as much like a real fish tank as possible. The fish should be able to do common fish things (swim, eat, die, breathe). The fish tank can contain a number of fish. Like a normal fish tank, there should be a pH level and an oxygen level. The fish should be able to do things that affect those levels and be affected by those levels. If there is not enough oxygen, fish die. If the pH is not in range, fish die. Additionally, the fish need to be fed and the oxygen level needs to be regulated. (Part A) For your design, first do an object-oriented analysis using CRC cards. (Part B) Then, create a UML diagram of your fish tank, based on that analysis.

Links to this Page