Change it to a constructor argument at the same time, and make the caller have a member variable for that same dependency.
同时给构造函数加上相应的参数,给构造函数的调用者加上一个成员变量来体现依赖关系。
Be sure to change the package, class, and constructor names in the Java code to match the project name.
确认代码中的包名、类名以及类构造函数名都已改为与项目名一致。
Then you change the constructor to take the name of the table, as well as the names of the fields in the table.
然后,把构造函数修改成接受表的名称和表中字段的名称。
The EJB 3.0 specification talks about public field injection and setter injection, but constructor injection will enable you to avoid creating setters for values you don't expect to change.
EJB 3.0规范谈到了公共字段注入和setter注入,但构造器注入将使您可以避免为预期不会更改的值创建setter。
The second change required is to construct (at the very least) an object array holding the actual values of parameters to be passed into the Collaborator class' constructor.
必需的第二项更改是(至少)构造一个保存传递给 Collaborator类的构造函数的参数实际值的对象数组。
The second change required is to construct (at the very least) an object array holding the actual values of parameters to be passed into the Collaborator class' constructor.
必需的第二项更改是(至少)构造一个保存传递给 Collaborator类的构造函数的参数实际值的对象数组。
应用推荐