diff --git a/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki b/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki index 9ff6e657..be5ea0e3 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki @@ -75,12 +75,22 @@ end -- class SAVINGS_ACCOUNT Without the redefine subclause, the declaration of deposit would be invalid, yielding two features of the same name, the inherited one and the new one. The subclause makes this valid by specifying that the new declaration will override the old one. In a redefinition, the original version -- such as the ACCOUNT implementation of deposit in this example -- is called the '''precursor''' of the new version. It is common for a redefinition to rely on the precursor's algorithm and add some other actions; the reserved word Precursor helps achieve this goal simply. Permitted only in a routine redefinition, it denotes the parent routine being redefined. So here the body of the new deposit (called "New implementation" above) could be of the form + Precursor (sum) -- Apply ACCOUNT's version of deposit ... Instructions to update the interest ... +In the event that a routine has redefined a particular feature from multiple parent, the Precursor syntax allows the inclusion of a parent qualification: + + + Precursor {PARENT_X} (args...) + -- Apply PARENT_X's version of this feature + ... Instructions to update the interest ... + + + Besides changing the implementation of a routine, a redefinition can turn an argument-less function into an attribute; for example a proper descendant of ACCOUNT could redefine deposits_count, originally a function, as an attribute. The Uniform Access Principle (introduced in [[ET: The Dynamic Structure: Execution Model|The Dynamic Structure: Execution Model]] ) guarantees that the redefinition makes no change for clients, which will continue to use the feature under the form acc.deposits_count