I'm designing a hospital integration system which consumes data from various hospitals (our customers), and then applies specific business rules to said data based on reading configurations from a database. If I were using Java, my first instinct would be to build a series of interfaces representing the various business rules, and then inject concrete instances (using Spring/guice) to compose a fully configured object. This would allow me to achieve a clean separation between configuration logic (what biz rules should apply to Hospital Foo?) and the actual business rules themselves.
Unfortunately, I'm not using Java, I'm using Lua. I've immersed myself in Lua literature over the last few days, and the closest analogue to DI appears to be the use of modules. Furthermore, it appears that the rules that govern how lua modules are resolved at run-time are based entirely on interrogating the local file system.
Is the "module pattern" the best/only way to achieve what am I after (separation of configuration logic from biz logic)? If so, how can one leverage Lua's module loading rules to vary the actual module(s) loaded at run-time?