@NongComEng@
Anuchit Prasertsang
from SoftPlus Family
Introduction
Spring FrameworkHelloWorld hello = new mypackage.HelloWorld();
<bean id="hello" class="mypackage.HelloWorld"></bean>
public class Email {
public void send() {
}
}
public class Notification {
Email email;
public Notification() {
email = new Email();
}
public void notifyPromotion() {
email.send();
}
}
public interface MessageService {
public void send();
}
public class Email implements MessageService {
public void send() {
}
}
public class Notification {
MessageService messageService;
public Notification() {
messageService = new Email();
}
public void notifyPromotion() {
messageService.send();
}
}