什么是Spring框架中的容器? [英] What is container in spring framework?

查看:814
本文介绍了什么是Spring框架中的容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我正在阅读这篇文章
    http://www.vaannila.com/spring/spring-ioc-1.html 此处使用术语
    容器。下图显示了容器。这篇文章中的
    容器是什么?它是一块代码还是bean
    config 文件?

  1. I was going through this article http://www.vaannila.com/spring/spring-ioc-1.html and here the term container is used. The diagram below shows container. What is container in this article? Is it a piece of code or the bean config file?

可以在Spring MVC中使用Spring IOC吗?

Can Spring IOC be used in Spring MVC?


推荐答案

在这种情况下,容器的含义可以提供某些组件生命所需的基础设施。

In this context a container has the meaning of something that provides an infrastructrure needed by some components to life.

你可以这样想象:


  • 就像JVM是运行Java程序的容器一样,

  • 一个Tomcat(或Servlet容器)通用)是运行servlet的东西

  • EJB-Container是EJB所在的环境(请参阅此维基百科文章(德语版,但您可以使用浏览器翻译器))

  • Like the JVM is a container to run Java Programms,
  • a Tomcat (or Servlet Container in general) is the thing that runs servlets
  • a EJB-Container is the environmet where EJB live (see this wikipedia article (in german, but you can use your browser translator))

就像Spring是Spring Beans所在的容器一样。

The same way Spring is the container where Spring Beans live.

这篇关于什么是Spring框架中的容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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