CSci 490-1 (Special Topics) / Engr 596-6 (Special Projects)
Software Design and Scala Programming
Spring 2010
Assignment #2
Due Thursday. 1 April 2010
Consider the Table ADT as defined in the instructor's paper
discussed at the beginning of the semester:
H. Conrad Cunningham, Yi Liu, and Jingyi Wang. “Designing a Flexible
Framework for a Table Abstraction,” Chapter 13 in Y. Chan, J. Talburt,
and T. Talley, editors, Data Engineering: Mining, Information,
and Intelligence, pp. 279-314, Springer, 2010. [manuscript]
- Using Scala, design and implement the Table ADT as
defined in the the paper. (Read on before you start coding or
panic.)
- Provide the basic features defined in the Access and Client
layers. You are not required to implement the Storage Layer,
the Externalization Module, or the extended features discussd in
section 9 and later. It is sufficient to use ordinary in-memory data
structures to implement the table.
- Instead of the Java Comparable interface, use either the
Ordered trait from the Scala API as discussed in section 12.4
of the Odersky et al textbook, or the Ord trait as in the
instructor's Natural
Number example.
- Separate the definition of the ADT interface into an abstract
class or trait. (For example, see the instructor's Cookie Jar example.)
- Develop at least two separate concrete classes that implement the
Table ADT interface. The implementations must use concrete
data structures that are distinctively different from each other. If
you wish, you may use a Scala Map data structure, or similar
data structure in the Java or other APIs, for one of the
implementations. However, the other(s) must use some quite different
concrete data structure (e.g., array, ArrayBuffer, some kind
of list, binary search tree).
- Be careful that all your table classes implement the semantics
specified in the paper. (That is, they should respect the principle
of substitutionality.)
- Challenge (required for graduate students, optional for
undergraduates): Implement the getKeys and
getRecords methods described in section 9.1 of the paper as a
part of your Table ADT. Use appropriate Scala features
instead of the Java Iterator.
- Challenge (optional, for those bored with the assignment so far):
In addition to the above, design and implement the MultiKeyed
features discussed in section 9.4.
- Challenge (optional, for the more adventurous Scala programmers):
Implement the Storage layer and Externalization module. Redesign your
Access layer code to use the Storage layer.
- Challenge (optional, for those who like concrete applications):
Design an application that uses your Table classes. For example, use
them to build an inverted index for a text file of words.
- Although you may use an IDE to develop the code, I will want to
just use the command-line tools to run it. Make sure the program runs
in that environment.
- Although GUIs are nice, it is better to focus on the ADT design,
implementation, and testing rather than trying to make a GUI work.
- Test the classes thoroughly. You should at least have an
appropriate blackbox test procedure that can be shown to work
correctly on all classes. (You may, of course, use graybox or
whitebox tests to test the specific classes.)
- Document the design and code appropriately. It would be a good
idea to state implementation invariants for your concrete
Table ADT classes.
- Submit your source code, documentation, testing output, and
execution instructions in a zip file using Blackboard.
UP to CSci 490-1 / Engr 596-6 Assignments?
Copyright © 2010, H. Conrad Cunningham
Last modified: Friday, 19 March 2010