CS/SWE 332 Assignment 4
Fall 2020


Goal: Data Abstraction / Mutability.

Rewrite Bloch's Stack class so that it is immutable. Keep the same representation. Follow Liskov. (We'll cover Bloch's additional constraints required for immutability later.)

Note that this is the same example we cover with in-class exercise #6.

Provide an overview, method signatures, method specifications, and the methods themselves. You do not need to provide the abstraction function or representation invariant for this exercise. Clean up anything that is no longer appropriate.

Note: A flyweight version of the Stack class makes for an interesting exercise. Any group that builds a high quality one and can explain why it's good earns 2 points of bonus credit. Contact me if you're interested.

Two more things: Remember that you're deliverable is a story. Remember that part of your group needs to synthesize the solution, and part of your group needs to verify the result.