Applying UML and Patterns: An Introduction to ObjectOriented Analysis and Design and Iterative Development, Third Edition [Electronic resources]

Craig Larman

نسخه متنی -صفحه : 472/ 352
نمايش فراداده

32.9. Class Hierarchies and Inheritance in Software

This discussion of conceptual class hierarchies has not mentioned

inheritance , because the discussion is focused on a domain model conceptual perspective, not software objects. In an object-oriented language, a software subclass

inherits the attribute and operation definitions of its superclasses by the creation of

software class hierarchies . Inheritance is a software mechanism to make superclass things applicable to subclasses. It supports refactoring code from subclasses and pushing it up class hierarchies. Therefore, inheritance has no real part to play in the discussion of the domain model, although it most definitely does when we transition to the design and implementation view.

The conceptual class hierarchies generated here may or may not be reflected in the Design Model. For example, the hierarchy of authorization service transaction classes may be collapsed or expanded into alternate software class hierarchies, depending on language features and other factors. For instance, C++ templatized classes can sometimes reduce the number of classes.