Modern Database Management (7th Edition)

Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden · Prentice-Hall, Inc eBooks · 2004

indicated by italics Dynamic means a patient can change A patient MUST be EXACTLY one of the subtypes from one subclass to another over time Chapter 14 22 © Prentice Hall, 2002 Class-Level Attribute Specifies a value common to an entire class, rather than a specific value for an instance. Represented by underlining “=“ is initial, default value. Chapter 14 23 © Prentice Hall, 2002 Polymorphism Abstract Operation: Defines the form or protocol of the operation, but not its implementation. Method: The implementation of an operation. Polymorphism: The same operation may apply to two or more classes in different ways Chapter 14 24 © Prentice Hall, 2002 Figure 14-11 – Polymorphism, abstract operation, class-scope attribute and ordering The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. , This operation is abstract...it has no method at Student level Class-scope attributes – only one value common to all instances of these clases Chapter 14 25 © Prentice Hall, 2002 Methods are defined at subclass level Overriding Inheritance Overriding: The process of replacing a method inherited from a superclass by a more specific implementation of that method in a subclass. – For Extension: add code. – For Restriction: limit the method. – For Optimization: improve code by exploiting restrictions imposed by the subclass. Chapter 14 26 © Prentice Hall, 2002 Figure 14-12 – Overriding inheritance The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. Chapter 14 27 © Prentice Hall, 2002 Restrict job placement Multiple Inheritance Multiple Classification: An object is an instance of more than one class. Multiple Inheritance: A class inherits features from more than one superclass. Chapter 14 28 © Prentice Hall, 2002 Figure 14-13 Multiple inheritance Chapter 14 29 © Prentice Hall, 2002 Aggregation Aggregation: A part-of relationship between a component object and an aggregate object. Composition: A stronger form of aggregation in which a part object belongs to only one whole bj t d i t l t f th h l bj t o ec an ex s s on y as par o e w o e o ec . Recursive Aggregation: composition where component object is an instance of the same class as the aggregate object. Chapter 14 30 © Prentice Hall, 2002 Figure 14 14 Example aggregation – Chapter 14 31 © Prentice Hall, 2002 Figure 14-15 – Aggregation and Composition The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. ( ) Cl di a ass agram The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

Read the paper · More papers on PaperTik