这样做主要是为了避免名称冲突:如果两个类具有相同的属性,映射为全局名可能会造成冲突。
This is primarily to avoid name clashes: If two classes have the same attribute and are mapped to global names, they may conflict.
作为一个例子,首先定义简单的rectangularobject类,它向配置API公开了三个主要属性:长、宽和高。
To illustrate this, let's first define a simple RectangularObject class, which exposes three key properties to the configuration API: the length, width, and height.
这种机制就是属性结构(attribute structure),它主要使所有类型的信息可与类本身或类的方法、字段及其他组件相关联。
This mechanism is the attribute structure, which basically allows all kinds of information to be associated with a class itself or with the methods, fields, and other components of a class.
应用推荐