måndag 11 juni 2012

Struktur

Föreläsning 24.

Denna gång går Mehran igenom ett programs struktur, hur du ska tänka när du bygger ditt program.

Principles:
nouns (substantiv) - classes
verbs - methods (associated with your classes)
unique identifier ex. Stanford Uni IDnr, ISBN nr, Artist + album + song

Design
collection of objects

Ex a musicstore called FlyTunes
add Songs
add Albums

class Song:   name - String
                    band - String
                    price - Double
Think about: What's gonna stay static and what's gonna change?