poem.simple.driver_adapter.SimulatedUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of poem-hexagon Show documentation
Show all versions of poem-hexagon Show documentation
A simple example for a hexagonal architecture.
package poem.simple.driver_adapter;
import poem.boundary.driver_port.IReactToCommands;
import poem.command.AskForPoem;
/**
* The driver adapter. It's on the left side of the hexagon. It sends user
* requests as command objects to a driver port on the hexagon boundary. For
* simplicity, sending is done autonomously without user interaction. That's
* why the class is called {@link SimulatedUser}.
*
* @author b_muth
*
*/
public class SimulatedUser {
private IReactToCommands driverPort;
public SimulatedUser(IReactToCommands driverPort) {
this.driverPort = driverPort;
}
public void run() {
driverPort.reactTo(new AskForPoem("en"));
driverPort.reactTo(new AskForPoem("de"));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy