Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package guru.springframework.config;public class GreetingServiceConfig {
}
2 changes: 2 additions & 0 deletions src/main/java/guru/springframework/config/PropertyConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package guru.springframework.config;public class PropertyConfig {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package guru.springframework.examplebeans;public class FakeDataSource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package guru.services;

public class GreetingServiceFactory {

private GreetingRepository greetingRepository;

public GreetingServiceFactory(GreetingRepository greetingRepository) {
this.greetingRepository = greetingRepository;
}

public GreetingService createGreetingService(String lang){
switch (lang){
case "en":
return new PrimaryGreetingService(greetingRepository);
case "de":
return new PrimaryGermanGreetingService(greetingRepository);
case "es":
return new PrimarySpanishGreetingService(greetingRepository);
default:
return new PrimaryGreetingService(greetingRepository);
}
}
}
Empty file.