Rating engine for parallel rating using DTOs

The AbstractDTOParallelRatingEngine is the base class for DTO rating engines. This class creates the parallel rater and provides methods that create and initialize access to the information in Cost and CostData objects.

Cost wrappers

Parallel DTO rating uses various classes for accessing Cost and CostData objects.
Parallel rating DTO costs include AbstractDTOParallelRatingEngine, ProxyCostDataInitWrapper, and ValueOnlyCostDataInitWrapper.
The ICostDataInitWrapper interface replaces many of the Cost references in the CostData and RatingEngine classes. Implementations of this interface perform the same functionality as the init methods in the CostData classes. There are two implementations of ICostDataInitWrapper:
ProxyCostDataInitWrapper
Acts as a proxy receiving a reference to a Cost entity. Create methods that retrieve property values from the entity. Use this proxy to maintain the logic in an entity-based parallel rating implementation. In the base configuration, parallel rating using entities implements this wrapper. This cannot be used by parallel rating using DTOs.
ValueOnlyCostDataInitWrapper
Copies all property values from a Cost object so that parallel rating can access these values without requiring access to the entity. In the base configuration, parallel rating using DTOs implements this wrapper.

Initializing cost wrappers

Any rating engine extending AbstractDTOParallelRatingEngine must implement the initializeCostWrappers method. This method populates a map of ICostInitDataWrapper objects containing all CostData information. The preRateStep method in the parent threads accesses CostData indirectly through these wrappers.

Handling CostData created by the rating engine

During parallel rating, CostData objects generated by child threads are added to a temporary map, called the staging map. In AbstractDTOParallelRatingEngine, see the addStagedCost and addStagedCosts methods. After rating, the postRateStep method applies the staged CostData objects to the CostDataMap for the policy line.