READING CHAPTER 13 SECTION 6 "Inheritance versus Interface" - inheritance and interface - features to support OO modeling - model is-a relationships - intended uses very different - interface - share common behavior (method headers) among instances of different classes - one class can implement multiple interfaces - inheritance - share common code among the instances of related classes - a single subclass can extend at most one superclass - superclasses include data members and/or methods that are shared by the subclasses - unlike interface, is a specialization relationship - don't use inheritance to model a service class - *code reuse by composition* model a service class as a component (vs modeling via specialization) - weaknesses if substitute inheritance for composition - clients have access to inapplicable methods - difficult to change implementation, because all inherited methods could be used to clients