30. 도메인 이벤트
•도메인에서 이벤트발생,
•이벤트핸들러가이벤트에반응
30
public class Delivery {
public void start() {
…
Events.raise(
new DeliveryStartedEvent(
this.id,
this.state,
this.startingTime)
);
}
public class EventHandler {
public void handle(
DeliveryStartedEvent evt) {
… // 통지 처리
}
}