I'm still trying to decide what is the best domain isolation for the game structure.
I have read that the Infrastructure layer provides support to higher layers, it could be a library shared by the other domains. In such way, the file access, image loading, drawing in the screen, reading the keyboard,… all of them are part of the infrastructure and the higher layers know and use them.
But in order to change them and implement them without affecting the model domain, we need to reverse the dependency and use a Plugin Architecture.
That is my goal, manage all the infrastructure as plugins. We can use the public interfaces and let the plugins implement them.
It is easy when the arguments are basic language types (int, float, String, …), but what happens when those public interfaces have high level arguments.
How can I pass an image as an argument?
I need to define what is an image, and the plugins need to understand it.
But not only an image, in the future, the engine will have multiple components like the transformation, collision, … and all the plugins need to understand them.
So I will put all data types in a new package (module) and avoid any specific platform data type or reference (for example java.awt.Image).
You can try the game release in my project
https://www.gamedev.net/projects/3695-hangman/
or directly download it from
https://gotanod.itch.io/hangman