Java – what does “container” mean in the context of programming?

I'm learning spring. The term "spring container" often appears in this article However, I know that "container" is not only used in spring (EJB container, etc.), so what does it mean to use it in the context of programming?

Solution

A container is something that contains something else

>In spring: the spring container contains beans (Java objects need dependency injection) > the servlet container contains servlets, filters, listeners, etc., and manages their state and life cycle There is also a similar portlet container > EJB container that contains EJBs (stateless, stateful, message driven) and manages their pools and lifecycles as described above > java awt. Container "is a component that can contain other AWT components"

You can see that the container is used to own and manage a set of objects, so you don't have to instantiate directly

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>