注释类型 Service


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    @Component
    public @interface Service
    Indicates that an annotated class is a "Service", originally defined by Domain-Driven Design (Evans, 2003) as "an operation offered as an interface that stands alone in the model, with no encapsulated state."

    May also indicate that a class is a "Business Service Facade" (in the Core J2EE patterns sense), or something similar. This annotation is a general-purpose stereotype and individual teams may narrow their semantics and use as appropriate.

    This annotation serves as a specialization of @Component, allowing for implementation classes to be autodetected through classpath scanning.

    从以下版本开始:
    2.5
    作者:
    Juergen Hoeller
    另请参阅:
    Component, Repository
    • 可选元素概要

      可选元素 
      修饰符和类型可选元素说明
      Stringvalue
      The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
    • 元素详细资料

      • value

        @AliasFor(annotation=Component.class)
        String value
        The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
        返回:
        the suggested component name, if any (or empty String otherwise)
        默认值:
        ""