The title sounds like a bit unclear and I am not sure about the terminology. But my problem is: I am now implementing the license verification function of our software, which consists of several modules. For example, the function call is something like License.IsModuleEnabled(m As Module)
(the code is in VB.NET)
Now the thing is, it is common for one module to require another module as a prerequisite, for example, for ModuleA to run, ModuleB must be enabled as well. So in Module
class I have a public number called RequiredModules
which is a list of Module
. So the IsModuleEnabled()
function would look something like this:
Public Function(m As Module)
...
For Each module In m.RequiredModules
If Not IsModuleEnabled(module) Then Return False
End For
...
End Function
The problem is obvious (but the solution is not to me): if ModuleA requires ModuleB, and ModuleB requires ModuleA, the function would go to a dead loop.
Those modules they are parallel to each other so I don't have a clue how to manage such a verification function. Our current solution is that only some "basic" modules can be listed in the RequiredModules
, but for long term, to have all modules possible to appear in the list would be better.