Background: I'm building a prototype scientific app with the "Exploration" and "Optimisation" parts. (Other parts might be needed later.) Each part uses functional reactive programming (FRP) and has its own GUI window. "Optimisation" depends on the user's choices within "Exploration"; there's no dependency the other way. Although the language is Scala, integration with Python, and possibly R, will be needed in future.
First, I've built an "Exploration"-only app based on the "onion" (clean) architecture and DDD principles. (The app is implemented as a multi-module sbt project in Intellij; see Figure 1.) I'm happy with this individual app.
Figure 1: "Exploration"-only project with the "onion modules" shaded. Omitted dependencies: Main on every module; every module on Utils.
Problems started when adding the "Optimisation" part to the same Intellij project. In DDD terms, "Exploration" and "Optimisation" are distinct bounded contexts. Combining both in one project would require having two "onions" side-by-side. The complexity is noticeably greater than with the "Exploration"-only project.
Tried: I've looked into microservices, which seem attractive, e.g., to separate bounded contexts https://www.infoq.com/presentations/ddd-microservices-2016, but also have drawbacks https://adamdrake.com/posts/2017-05-20-enough-with-the-microservices.html; https://martinfowler.com/bliki/MicroservicePremium.html. As I've little experience with them, they're probably an overkill for this medium-size prototype, but may be useful in future.
My current idea is to split the project into four separate multi-module projects; see Figure 2. The independent "Core Project" contains all the support domains and the abstract core domain. The "Exploration" and "Optimisation" projects depend on it as an external project. The "Main" project, dependant on the other three, wires the whole application and is responsible for passing data from "Exploration" to "Optimisation".
Question: Is this solution reasonable and how could it be improved? Or is there a better solution?
Related: Several SE questions suggest using microservices, e.g. How can you separate a monolith into domain-driven libraries without duplicating interfaces and still keep dependencies simple?. There're also language-speficic questions, e.g. Microservices and shared libraries for Python.
Figure 2: Split into 4 external projects. Between-project dependencies (dashed lines) point upwards