I'm making an app that try to follow the Clean architecture guideline. The app use JavaFX as UI. JavaFX is make to use the MVC architecture. Is there a way to use both in conjunction like this?
My problem is i can't find a way to have a Controller and a Presenter that interact with the FXML file.
Currently i have this :
- An FXML file that declare a controller with fx:controller attribute
- A controller That handle event and called a usecase
A usecase like this:
public class SomeUseCase implements UseCase<Observable<String>> { private SomeRepository repository; public SomeUseCase(SomeRepository repository) { repository = repository; } @Override public void execute(Request request, Presenter presenter) { SomeUseCaseRequest req = (SomeUseCaseRequest) request; // I skip mapper that translate from request to entity and entity to repository // And vice-versa for the respponse for clarity presenter.render(this.repository.fetch(req.someParam)); } }