Last active
June 17, 2019 14:14
-
-
Save CristianoPassos/980c0cb3ccd162dd71d5bafb459bd64b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface MyServiceInterface { | |
void myMethod(); | |
} | |
@Service | |
public class MyServiceA implements MyServiceInterface { | |
@Override | |
public void myMethod() { | |
System.out.print("Do A"); | |
} | |
} | |
@Service | |
public class MyServiceB implements MyServiceInterface { | |
@Override | |
public void myMethod() { | |
System.out.print("Do B"); | |
} | |
} | |
@Service | |
public class MyBusinessLogic { | |
@Autowired | |
private MyServiceInterface myServiceInterface; | |
public void businessLogic() { | |
System.out.println("Do something"); | |
myServiceInterface.myMethod(); | |
System.out.println("Done"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment