object-oriented programming in Java
object has
- members or instance variables for holding local state
- methods for reading/writing members
class defines
- methods and members for all objects of the class
- a constructor for making objects of the class
computation model
- “sending a message to o”:
executing o.m (a1, a2, … )
causes object o to execute method m on its members with arguments a1, a2, …
- this is how other objects access the local state of o
inheritance
- can declare one class to be a subclass of another
- subclass gets all the methods and members of the superclass, but may redefine them
properties
- are coded as members
- with associations, have to decide where the state goes