Regardless of inheritance or compositing, we can create a new type based on an existing type. But in typical cases, we use compositing to implement the existing type of "regenerate" or "reuse" as part of the new type of foundation implementation process. However, if you want to implement the "regeneration" of an interface, you should use inheritance. Because a derived or derived class has an interface to the underlying class, it can be "traced back" to the underlying class. This is crucial to the question of the polymorphism that is to be described in the next chapter.
Although inheritance is particularly emphasized in object-oriented programming, it is best to consider the use of synthetic techniques when actually starting a design. The use of inheritance techniques should be considered only when it is particularly necessary (the next chapter will cover this issue). Synthesis appears more flexible. However, by applying some inheritance techniques to your own member types, you can change the type of those member objects accurately at runtime, thereby altering their behavior.
While for rapid project development, code regeneration through compositing and inheritance is a great help. But before allowing other programmers to rely entirely on it, it is generally desirable to redesign their class structure. Our ideal class structure should be that each class has its own specific purpose. They cannot be too large (such as the integration of too many functions, it is difficult to achieve its regeneration), nor too small (caused by their own use, or can not add new features). The final implementation of the class should be able to easily regenerate.