poem.simple.Main 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;
import poem.boundary.Boundary;
import poem.simple.driven_adapter.ConsoleWriter;
import poem.simple.driven_adapter.HardcodedPoemLibrary;
import poem.simple.driver_adapter.SimulatedUser;
/**
* Main class that starts the hexagon example application.
*
* The application is inspired by a talk by A. Cockburn and T. Pierrain on hexagonal architecture:
* https://www.youtube.com/watch?v=th4AgBcrEHA
*
* @author b_muth
*
*/
public class Main {
public static void main(String[] args) {
new Main().startApplication();
}
private void startApplication() {
// Instantiate driven, right-side adapters
HardcodedPoemLibrary poemLibrary = new HardcodedPoemLibrary();
ConsoleWriter consoleWriter = new ConsoleWriter();
// Inject driven adapters into boundary
Boundary boundary = new Boundary(poemLibrary, consoleWriter);
// Start the driver adapter for the application
new SimulatedUser(boundary).run();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy