I am actually working on application where a client depends on modules that needs to be downloaded from a repository server. The modules can be of any archive : jar, dll, zip, etc.
The client first submits a set of properties (a set of Key-Value already defined by the server) to the repository server. The server makes some computation based on those properties and return all modules correspond to the client. if the client needs a module that is outdated, the server will send the newest modules to the client so it can updates it. The server will also need to compute dependencies between modules and sent them to the client, like maven.
But, the main difficulty is I cannot make assumption about the properties sent by the client because they are specific to the client environment.
The first idea that I had, was to a have matrix where each column represents a property and each row represents a module. In the matrix, it would be possible to add and remove properties. And for each case in the matrix, I will add the value that corresponds for that module.
For instance, let say that I have 2 modules and a set of properties {OS, Archive, Arch, Version, .Net}
. For module1, the values are {OS="Windows 7", Archive="dll", Arch=32-bits, Version="2.0.0",.net=3.5}
. For module2, the values are {OS="Windows 7", Archive="jar", Version="2.1",.net="4.0"}
But this case works perfectly for if each property contains only one value. If the client says I want all the modules that works on Windows 7 (module1
and module2
) and runs on a but but for which dll
archive supports version of superior of .net 3.5, . module1
will be returned.
That's work perfectly.
But what if each property can contain multiple values (which is our case). For instance, in our previous example, if module1 can run in Windows 7, Vista, XP. For the OS property, I will have to go for each property sent by the client and search for the correct value. That's a combinatorial calculation.
What I see in this process is very similar to a package management system, like apt, yum.
What is the better approach to this problem?