RU beehive logo ITEC dept promo banner
ITEC 380
2009fall
ibarland

homeinfolecturesexamshwsarchive

lect03a
types as sets

Review:
We saw 'Book', and method 
A function book -> book; immutable.
  vandalize : book -> book    (half the #pages, and blend the title/author)
How do test-cases look in Java?  S.o.p( ... )
Btw: write this as a static method, or not?
   How are they related?  
   Discuss: superficially rewrite any ITEC120 java program
     so that it's static.  `this` as an implicit parameter.

Types as sets.
compare math's function notation w/ our signatures.
Ways to combine types:
  x
  U   [to be seen]

Updating The Design Recipe

(Adapted from How to Design Programs)
For each type of data involved:
    1. Data Definition (how will you represent an age, a gender, a book, etc.)
    2. Examples of the Data   (trivial first)
Then, for each function involving that data:
    3. description, signature, and header/stub
    4. test cases
    5a.  case analysis
    5b. selectors  (what is the type of each?)
    5c. add any natural/pertinent function calls on these pieces
    5d. assemble the parts of 5b.  
    6. Run tests.

homeinfolecturesexamshwsarchive


©2009, Ian Barland, Radford University
Last modified 2009.Sep.16 (Wed)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme