Think about the benefits you get from nested engines. Nesting means connecting, and if you want to improve maintainability and testability, you must reduce this connection. I think that the ideal engine should work autonomously easily - thatβs why you have a dummy
application created in the test
directory. Of course, you can keep nesting or maintain common material in the main application, but you will see that with a growing code base it is more difficult to maintain tests with tightly related dependencies.
As a solution, I would try composition. Place the engine catalogs next to each other, but use the nested modules:
engines/foo_project - namespaced FooProject::* engines/foo_project_user - namespaced FooProjectUser::* or FooProject::User::*
If there is something that FooProject::User
is required of FooProject
, then ideally it should be extracted to another engine, for example FooProject::Layout
. In the other direction, the main application should pass the User
material to FooProject
. Add integration tests to the main tier of the application and you will get ordnung.
source share