I have a main application that can load modules (or plugins). Each modules can define one or more links (or items) that will be displayed in a side menu defined in the main application.
Right now, my main application execute a list of ItemProviders which are loaded from the modules. These ItemProviders return a list of items to display in the side menu.
My question now is how am I supposed to order these items since they are not aware their siblings in the menu? Keep in mind that there is not a particular logic in the order, it depends on what the client wants.
My primary solution was to give them an order number (an index). The problem with this approach is that my modules would no longer be completely independent, the "order number" would depend on other modules' number.
What would be the proper way to handle this particular case?