Inheriting in the servlet class, generally using template mode, reusing base class, while providing an interface to extend its own method, this time the coupling degree of derived classes and base classes is very high, you have to know what the base class is doing? Increased the difficulty of maintenance of the system, especially when a new person took over, he took more details. My idea is that this derived relationship is sometimes inevitable, but it is necessary to master the following principles: (1) This derived relationship should be as small as possible, that is, the derived level is less, it is best enough to be a layer. . (2) Things doing things as much as possible, don't put it until the base class is not necessary. In particular, it is best to put less, even if you don't put it.