Create instance of a Class
One can create an instance of a java bean. To appreciate the use of it, let us consider a case where one has to create an instance of a java bean with some twenty fields as shown below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public class SomeClass { public void someThing () { final PersonVo personVo = new PersonVo(); personVo.setFirstName(firstname); personVo.setLastName(lastname); personVo.setTitle(title); personVo.setDateOfBirth(dateOfBirth); // and so on with twenty other fields. // more code ... } } |
1 2 3 | < bean id = "personServiceImpl" class = "com.test.service.impl.PersonServiceImpl" > < property name = "addressDAO" ref = "addressDAO" /> </ bean > |