什么是弹簧“定型"? [英] What is a Spring "stereotype"?

查看:193
本文介绍了什么是弹簧“定型"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SpringSource博客条目上,以下句子引用了定型.

On a SpringSource blog entry, the following sentence references a stereotype.

因为@Controller是Spring的@Component的特化 刻板印象注解,该类将被自动检测 Spring容器是容器组件扫描的一部分 过程,创建一个bean定义并允许实例成为 像其他任何Spring托管组件一样注入依赖项.

Because @Controller is a specialization of Spring's @Component Stereotype annotation, the class will automatically be detected by the Spring container as part of the container's component scanning process, creating a bean definition and allowing instances to be dependency injected like any other Spring-managed component.

构造型"一词的用法是什么?这是一个技术性春季学期吗?还是只是在一般意义上使用了刻板印象?

What does this usage of the word stereotype reference? Is this a technical Spring term? Or is stereotype just used in a general sense?

推荐答案

表示类型或方法在整个体系结构中的作用的注释(在概念上,而不是在实现上).

Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level).

来自 Merriam-Webster stereotype的名词定义是这样的:

The noun definition of stereotype from Merriam-Webster says this:

符合固定或普遍模式的东西;特别是:小组成员共同拥有的标准化的心理图片,它代表了过于简化的观点,偏见或不加批判的判断

something conforming to a fixed or general pattern; especially : a standardized mental picture that is held in common by members of a group and that represents an oversimplified opinion, prejudiced attitude, or uncritical judgment

似乎是为了暗示正在注释的特定类的角色.这似乎很有意义,因为通常建议您使用@Controller注释Controller类,使用@Service注释服务类,等等.

It seems that it is for suggesting a role of particular class that is being annotated. This seems to make sense because it is often recommended that you annotate your Controller classes with @Controller, Service classes with @Service, and so on.

除了明显的组件扫描功能外,Spring还建议它们为您的AOP需求提供很好的切入点分界.

In addition to the obvious component-scanning functionality, Spring suggests that they make nice point-cut demarcations for your AOP needs.

这篇关于什么是弹簧“定型"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆