joe_blaze wrote:Also processing the virtual paths "longest to shortest" is a "particular processing order" which might not be ideal for some users. First we are going to identify the existing processing order and then consider if it can be made more flexible.
By "particular processing order", I thought you meant that you wanted to let the user
select the order in which he wanted them processed.
If you're just selecting your own processing order, then logically you only have two choices: "longest to shortest" and "everything else". If you process them longest to shortest, that is mathematically guaranteed that all the listed possibilities are sure to be available to be processed. If you arrange the list in any other way, only two results are possible:
- Results are identical to processing in longest-to-shortest order
- A shorter path is always taken instead of a longer one, thus rendering the longer path completely "dead" and forever unusable.
Therefore, there is no possible way to order the paths that can be more or less ideal for any given user. Either all their requests can potentially be satisfied, or some of their requests (virtual paths) will be forever ignored and can simply be deleted from the list.
You could also randomize the order on every call and get a random mix of these two results, but that's ridiculous.
You could also alphabetize the paths (or use any other ordering pattern) for human readability, but make sure that shorter paths that are included as exact leading text of any longer paths always come anywhere AFTER those longer paths. However, except for human-display order, this produces results identical to strict longest-to-shortest ordering. This is probably the kind of thing you were considering, but it doesn't have any effect at all on the actual processing order.
You are perfectly welcome to continue to consider other possibilities for flexibility, but I think you'll find what I've discussed above to be invariably true. If you like, I'd be happy to discuss the logic of the above conclusions with you in more detail as part of your deliberations, but I'm convinced of their validity.