什么是注释,它们如何真正适用于像Spring这样的框架? [英] What are annotations and how do they actually work for frameworks like Spring?

查看:100
本文介绍了什么是注释,它们如何真正适用于像Spring这样的框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Spring的新手,现在我听到很多关于Spring Framework的日子。我有两组非常具体的问题:

I am new to Spring and now a days I hear a lot about Spring Framework. I have two sets of very specific questions:

设置1号:


  • 一般来说注释是什么?

  • What are annotations in general ?

注释如何使用Spring框架专门工作

How does annotations works specifically with Spring framework ?

可以在
Spring Framework之外使用注释,还是
特定于框架?

Can annotations be used outside Spring Framework or are they Framework specific ?

第2集:


  • Spring Framework的哪个模块是
    在工业中广泛使用?

  • What module of Spring Framework is widely used in Industry ?

我认为它是Spring MVC,但为什么
是最多的使用模块,如果我是
正确或纠正我吗?

I think it is Spring MVC but why it is the most used module, if am correct or correct me on this ?

我是Spring的新手,所以随意编辑这些问题以使其更有意义。

I am newbie to Spring and so feel free to edit this questions to make more sense.

推荐答案


一般注释是什么?

What are annotations in general?

注释可以被认为是类的元数据。

Annotations can be thought of as meta-data for classes.


注释如何工作
特别是Spring框架?

How does annotations works specifically with Spring framework?

Spring使用注释作为XML的替代方法进行声明性配置。有些人不喜欢XML。

Spring uses annotations as an alternative to XML for declarative configuration. Some people don't like XML.


可以在Spring
Framework之外使用注释,还是Framework
特定的?

Can annotations be used outside Spring Framework or are they Framework specific?

您需要实现JAR才能使用任何注释,因此如果您使用 使用的注释弹簧。注释是Java 5中引入的一般概念。您也可以自己编写。

You need the implementation JARs to use any annotation, so if you use the annotations you are using Spring. Annotations are a general idea introduced into Java 5. You can write your own as well.


Spring Framework的哪个模块是
在工业中广泛使用?

What module of Spring Framework is widely used in Industry?

所有其他模块都使用Spring Core;因此得名。

Spring Core is used by all the other modules; hence the name.


我认为它是Spring MVC,但为什么它是
最常用的模块,如果是正确的或
纠正我这个吗?

I think it is Spring MVC but why it is the most used module, if am correct or correct me on this ?

绝对不正确。 Spring MVC有很多竞争对手(例如,Struts 1和2,JSF,Wicket,Flex等),因此它并不总是Web MVC的首选。所有使用Spring的应用都不是网络应用。 Spring Batch和Integration非常受欢迎且不断增长。

Absolutely incorrect. Spring MVC has lots of competitors (e.g., Struts 1 and 2, JSF, Wicket, Flex, etc.), so it's not always the first choice for web MVC. And all apps that use Spring aren't web apps. Spring Batch and Integration are quite popular and growing.

这篇关于什么是注释,它们如何真正适用于像Spring这样的框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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