什么是注解以及它们如何在 Spring 这样的框架中实际工作? [英] What are annotations and how do they actually work for frameworks like Spring?

查看:42
本文介绍了什么是注解以及它们如何在 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:

第一组:

  • 一般的注解是什么?

  • 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 ?

第二组:

  • 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之外使用吗框架还是它们是框架具体?

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

您需要实现 JAR 才能使用任何注解,因此如果您使用注解,那么您就是使用 Spring.注解是 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 的应用程序都不是 Web 应用程序.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天全站免登陆