poem.boundary.Boundary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of poem-hexagon-nextgen Show documentation
Show all versions of poem-hexagon-nextgen Show documentation
This is the next generation of the poem-hexagon application.
package poem.boundary;
import java.util.function.Consumer;
import org.requirementsascode.Model;
import org.requirementsascode.ModelRunner;
import poem.boundary.driven_port.IObtainPoems;
import poem.boundary.driver_port.IReactToCommands;
import poem.boundary.internal.command_handler.PickRandomPoem;
/**
* The boundary class is the only point of communication with left-side driver
* adapters. It accepts commands, and calls the appropriate command handler.
*
* On creation, this class wires up the dependencies between command types and
* command handlers, by injecting the command handlers into a use case model.
*
* After creation, this class sends each command it receives to the runner of
* the use case model. The model runner then dispatches the command to the
* appropriate command handler, which in turn calls the driven adapters.
*
* @author b_muth
*
*/
public class Boundary implements IReactToCommands {
private ModelRunner modelRunner;
public Boundary(IObtainPoems poemObtainer, Consumer