I am using springs AutoPopulateList using following METHOD 1
passports = new AutoPopulatingList<Passport>(Passport.class);
METHOD2 and also first creating Passportfactory
public class PassportFactory implements AutoPopulatingList.ElementFactory {
private Person person;
public PassportFactory(Person person) {
this.person = person;
}
public Object createElement(int index) {
Passport passport = new Passport();
passport.setPerson(person);
return passport;
}
}
然后使用
List<Passport> passports = new AutoPopulatingList(new PassportFactory(this));
现在,这两部法典都在发挥作用,但我不知道二部法典之间的区别是什么,二部法典由于从互联网上复制而将如何发挥作用。 一个人能够向我解释区别