August 2018
Intermediate to advanced
314 pages
8h 9m
English
Suppose a client wants to send emails to college students, inviting them to a science and technology seminar. And suppose that the emails that were sent generate statistical information for later analysis. In this case, the client does not need to wait for the answer immediately. We can make an event producer and two event observers: an observer responsible for sending the email itself and an observer responsible for statistical control. The two processes are independent of each other. The following code shows the producer and the two observers.
This is the SeminarProducer class:
public class SeminarProducer { @Inject private Event<Seminar> seminarEvent; public void sendEmailProcess(Date ...Read now
Unlock full access