• Home
  • Textbooks
  • A little Smalltalk
  • A Simple Application

A little Smalltalk

Timothy Budd

Chapter 5

A Simple Application - all with Video Answers

Educators


Chapter Questions

Problem 1

Add messages to delete employees from the database.

Check back soon!

Problem 2

Is it necessary to have both the messages initialize and upDate in EmployeeRecord ? Can one be replaced with the other? What changes would the user notice?

Check back soon!

Problem 3

As it stands, the application is rather lax about error checking. Add checks to make sure a new employee record does not override an older one and that a request to update specifies a valid employee identification number.

Check back soon!

Problem 4

In the scheme described in this chapter, identification numbers are different from the other fields in the employee record. They are kept only as keys in the database and not as part of the record, for example. Change the class EmployeeRecord so that it maintains the identification number as part of the record. What changes are then required in EmployeeDatabase ?

Check back soon!

Problem 5

Instead of maintaining an instance of Dictionary in EmployeeDatabase, one could make it a subclass of Dictionary. How would this change the methods for this class? What are the advantages and disadvantages of both schemes?

Check back soon!