Skip to content

Commit 3ac9666

Browse files
author
codehunter34
committed
BAEL-2399: Guice vs Spring - Dependency Injection
1 parent bd63df8 commit 3ac9666

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.baeldung.examples.common;
2+
3+
import org.springframework.stereotype.Component;
4+
5+
@Component
6+
public class PersonDaoImpl implements PersonDao {
7+
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.baeldung.examples.guice;
2+
3+
import com.baeldung.examples.common.PersonDao;
4+
import com.google.inject.Inject;
5+
6+
public class GuicePersonService {
7+
8+
@Inject
9+
private PersonDao personDao;
10+
11+
public PersonDao getPersonDao() {
12+
return personDao;
13+
}
14+
15+
public void setPersonDao(PersonDao personDao) {
16+
this.personDao = personDao;
17+
}
18+
19+
}

0 commit comments

Comments
 (0)