What is meant by abstract=“true” in spring?

后端 未结 2 634
挽巷
挽巷 2020-12-02 18:35

Abstract classes cannot be instantiated in java. But spring says something like bean creation with abstract=\"true\". If a state of an abstract class is initial

2条回答
  •  天命终不由人
    2020-12-02 19:02

    Actually, abstract parent bean is not necessary to define class attribute, you may just need a common property for sharing.

    According to this tutorial

    The parent bean cannot be instantiated on its own because it is incomplete, and it is also explicitly marked as abstract. When a definition is abstract like this, it is usable only as a pure template bean definition that serves as a parent definition for child definitions.

提交回复
热议问题