CDI包含一个cdi容器服务,该服务根据应用程序作用域声明自动管理作用域;容器根据需要创建和销毁CDI bean。
CDI includes a CDI container service that manages scope automatically depending on the application scope declaration; CDI beans are created and destroyed on demand by the container.
为阐述该机制的功能,Ruby语言本身使用sticky属性来声明private、protected和public类作用域修饰符。
To illustrate this mechanism's power, the Ruby language itself USES sticky attributes to declare private, protected, and public class-scope modifiers.
所有这四个变量都是在循环外声明的,尽管它们仅在循环内部使用,但作用域不止于此。
All four variables are declared outside the loop and therefore have excessive scope even though they're only used inside the loop.
应用推荐