Transcript design

Circle
Keeps on rolling
Problem – design a circle representation
 Some possible questions to ask
 What kind of circle?
 Why not use an existing circle representation?
 What plans do you have for the circle?
 What attributes are needed?
 What attributes are desired?
 How soon?
 How robust?
Problem – design a circle representation
 Demanded
 A mathematical entity-like representation suitable for locating on
a two-dimensional layout
 Implication – need radius and location
 Circle needs to be modifiable – think mutators
 Resized
 Repositioned
 Circle status needs to be accessible – think accessors
 Have standard features of other representations
 Cloning
 Comparing
 Stringifying
Design
 Question
 Should we practice encapsulation?
 Does direct attributes allow representation to be non-sensible?