#113 Event Driven Architecture

Adds more Javadoc
This commit is contained in:
cfarrugia
2015-11-28 13:12:16 +01:00
parent fc70a706c6
commit b8b94b697a
12 changed files with 112 additions and 61 deletions
@@ -7,22 +7,21 @@ import com.iluwatar.eda.handler.UserCreatedEventHandler;
import com.iluwatar.eda.handler.UserUpdatedEventHandler;
/**
* An event-driven architecture (EDA) is a framework that orchestrates behavior around the production,
* detection and consumption of events as well as the responses they evoke.
* An event is any identifiable occurrence that has significance for system hardware or software.
* <p/>
* The example below we uses an {@link EventDispatcher} to link/register {@link Event} objects to
* their respective handlers Once an {@link Event} is dispatched,
* it's respective handler is invoked and the {@link Event} is handled accordingly
* An event-driven architecture (EDA) is a framework that orchestrates behavior around the
* production, detection and consumption of events as well as the responses they evoke. An event is
* any identifiable occurrence that has significance for system hardware or software. <p/> The
* example below we uses an {@link EventDispatcher} to link/register {@link Event} objects to their
* respective handlers Once an {@link Event} is dispatched, it's respective handler is invoked and
* the {@link Event} is handled accordingly
*/
public class App {
public static void main(String[] args) {
EventDispatcher dispatcher = new EventDispatcher();
dispatcher.registerChannel(UserCreatedEvent.class, new UserCreatedEventHandler());
dispatcher.registerChannel(UserUpdatedEvent.class, new UserUpdatedEventHandler());
dispatcher.dispatch(new UserCreatedEvent());
dispatcher.dispatch(new UserUpdatedEvent());
}
public static void main(String[] args) {
EventDispatcher dispatcher = new EventDispatcher();
dispatcher.registerChannel(UserCreatedEvent.class, new UserCreatedEventHandler());
dispatcher.registerChannel(UserUpdatedEvent.class, new UserUpdatedEventHandler());
dispatcher.dispatch(new UserCreatedEvent());
dispatcher.dispatch(new UserUpdatedEvent());
}
}