![]() Proper descendants exclude the class itself. Note: This discussion will rely on the terminology introduced in The Static Picture: System Organization: descendants of a class are the class itself, its heirs, the heirs of its heirs and so on. Later sections ( "Multiple inheritance and renaming" and "Repeated inheritance and selection" ) will explain how to handle possible conflicts between parent features. Eiffel supports multiple inheritance: a class may have as many parents as it needs. This makes D an heir of A, B and any other class listed. ![]() To make a class inherit from another, simply use an inherit clause: Everyone should understand these "correct answers" if only to understand how to work around the limitations in other languages. Paul Dubois has written ( Usenet newsgroup, 23 March 1997): there are two things that got right that nobody else got right anywhere else: support for design by contract, and multiple inheritance. Many of the techniques are original with Eiffel. Eiffel has made a particular effort to tame inheritance for the benefit of modelers and software developers. ![]() A look at either the practice or literature shows, however, that it is not always well applied. Inheritance is a powerful and attractive technique.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |