BAEL-2399: Guice vs Spring - Dependency Injection

This commit is contained in:
codehunter34 2019-01-01 02:46:06 -05:00
parent bd63df8caf
commit 3ac96662fc
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package com.baeldung.examples.common;
import org.springframework.stereotype.Component;
@Component
public class PersonDaoImpl implements PersonDao {
}

View File

@ -0,0 +1,19 @@
package com.baeldung.examples.guice;
import com.baeldung.examples.common.PersonDao;
import com.google.inject.Inject;
public class GuicePersonService {
@Inject
private PersonDao personDao;
public PersonDao getPersonDao() {
return personDao;
}
public void setPersonDao(PersonDao personDao) {
this.personDao = personDao;
}
}