Software Engineering I Sept. 6, 2013 Instance Variables for Classes -list of variables for a class dentoting data that may be present in each instance -Attributes represent properties of the object Example: Employee -name -dob -ssn -telNum -address Association - relationship between one class and another Example - supervisor association relates class Employee to class Manager tasksToDo association relates class Task to class Employee Recall that variables and objects are not the same in Java. In Java, variables _refer_ to objects. That is, variables are references. The _type_ of a reference determines what classes it may refer to. Instance vs. class variables Recall that each instance of a class has its own set of instance variables. Recall that each class has exactly one set of class variables that are shared among instances. +----------------+ | Employee | +----------------+ | name | | dob | | address | | title | | num_employees | <-- notice that class variables are underlined | ------------- | +----------------+ +----------------+ | Tyler:Employee | <--Tyler is an instance of the Employee class | ----- | +----------------+ | name="Tyler" | <--Instance variables exist for each instacne of the class | dob="9/2/1977" | | address="Here" | | title="Dev." | +----------------+ Methods, Operations, and Polymorphism Method - procedural abstraction used to define functionality of a class Operation - more abstract than procedure, may be independent of code. Polymorphism - having many forms Examples include method overloading or overriding