The Department of Computer Science & Engineering |
STUART C. SHAPIRO: CSE
115 C
|
"a model is a simplified representation of something else." [p. 2]
Divide and conquer: A model is composed of models of the components of the thing being modeled.
Waterfall process for building models:
Definition in English
Analysis in detail of definition
Specification
precise contract with user
Design
of model to be implemented
Implementation
of design (in Java)
Testing
implementation thouroughly
Encapsulation: hiding details that are not important to users.
Hierarchies: put common details higher up.
E.g.: animals, mammals, predators, cats
Java says mammal extends animal, ...
Instances: Tom, Sylvester, Fluffy
Java says Tom = new cat();
Java compiler
Correctly compiled program may still have logical errors.
It may crash,
or it may do something, but not the correct thing---only you can tell.
Implementation cycle:
Repeat { Code more of the model; Repeat { Repeat { Compile; debug syntax; } until compiles; Test; debug a logic error; } until correct; } until complete;