Class TaskApp
java.lang.Object
com.guinetik.hexafun.examples.tasks.TaskApp
Task application demonstrating the port registry feature.
Key concepts demonstrated:
- Port registration:
.withPort(TaskRepository.class, impl) - Port retrieval:
app.port(TaskRepository.class) - Use cases using ports for persistence
- Separation of domain logic from infrastructure
The repository is injected as a port, allowing easy swapping between in-memory (for testing) and persistent implementations.
-
Constructor Summary
ConstructorsConstructorDescriptionTaskApp(TaskRepository repository) Create a TaskApp with the given repository implementation. -
Method Summary
Modifier and TypeMethodDescriptioncompleteTask(String taskId) createTask(String title, String description) deleteTask(String taskId) getApp()Get the underlying HexaApp (for testing/introspection).Get the repository port directly.static voidupdateTask(String taskId, String title, String description) static TaskAppCreate a TaskApp with an in-memory repository.
-
Constructor Details
-
TaskApp
Create a TaskApp with the given repository implementation.
-
-
Method Details
-
withInMemoryRepo
Create a TaskApp with an in-memory repository. -
createTask
-
startTask
-
completeTask
-
updateTask
-
deleteTask
-
findTask
-
listTasks
-
getApp
Get the underlying HexaApp (for testing/introspection). -
getRepository
Get the repository port directly. -
main
-