The current EntitiesDescriptorAssemblerStage allows the specification of an ordering strategy (defaulting to a no-op strategy) which is used to order the entities within the container. It has a nested interface for this operation.
This is at present the only circumstance in which entities in a collection can be reordered. It would be better to:
- Extract the strategy interface into the pipeline package
- The interface should be made generic on item type
- It should be specified produce an unmodifiable collection
- Add an ItemOrderingStage which performs reordering on the basis of such a strategy
- Refactor the current functionality of EntitiesDescriptorAssemblerStage to use the new interface, OR, remove the ordering functionality entirely. The latter would be cleaner but would require deployers to add another stage to their deployments.