Crossreferencing umbrella applications


I identified a subsystem that can be used across several subsystems and started to extract it as umbrella application, but the thing is that not only the web application must be able to access it, this subsystem app must be able to access 3-4 modules from the main app.
I tried to set them both as dependencies to each other but that lead to the cyclic dependencies error.
What are possible options to build described setup?

Make those subsystems also OTP apps, or pass in the other subsystem’s modules are options to the first subsystem as configuration options or function call parameters.


I’d say, that this makes these 4 modules candidates to move them either into the existing sub-system or another one.

@KronicDeth dang, it’s two chapters away in Elixir in Action! Thanks for hint :wink:

@NobbZ those modules are mostly related to the database operations and I don’t know a proper way to do that: the main app is the Phoenix project and thus database configuration should reside there. So far exposing a behavior from sub-system, implementing it in the main app and then passing those modules as dependencies seem to be a way to go.

Well, I think it is the other way round. The WEB-part should only know about the web-stuff.

Maybe it knows, that it can information about Users, Posts, Messenges and other stuff out of another Application, but it does not care about if that other application holds everything in memory, on disk in plain text files or in a database (and if this is SQL or not).