Interface SortPositionStrategy<P>

  • Type Parameters:
    P - The business domain type
    All Known Implementing Classes:
    DecimalSplitSortPositionStrategy

    public interface SortPositionStrategy<P>
    Represents an approach for updating a sorted field's value. This is generally more difficult and specialized than a normal field update since sorting represents a relationship between multiple records. Often, sorting field changes not only result in a change to the target record, but also a resequence of all the other records in the group. This is especially problematic in the context of sandboxing and catalog hierarchies. The expectation is that a single record is being updated and sandbox versions or catalog overrides are being established. Brute-force resequencing would likely have an impact on this structure (e.g. you wouldn't want to create a new sandbox version for every resequenced record, as this could be overwhelming). Common tenants that a sort positioning strategy should try to achieve are:
    • Try to avoid resequencing records to keep the sort accurate
    • Without resequencing, try to adopt solutions that provide enough buffer for positioning. For example, a viable solution could be to assign a position that is the natural split of the before and after positions at the target. However, perform this split enough times at that position and your decimal implementation may run out of scale quickly.
    • Generally, allow for sorting of non-null values. Any null values should appear last, or a placeholder value other than null should be used to differentiate a unspecified sort record.
    Author:
    Jeff Fischer