Creating cost methods
Cost methods implement the methods and properties for the cost. Often, cost methods are used to get properties on the cost. The abstract cost and cost subtypes delegate to the cost methods for the line.
The base configuration provides one interface for the cost methods in each policy line. In Golf Cart, you define the interface in the GOCostMethods class. The abstract cost and cost subtypes delegate to this interface. The line level interface defines cost properties that are required for any of the specific cost types. Typical required cost properties include the coverage, any coverables other than the policy line, and other properties required in the user interface, such as properties for the quote page. Properties can include the policy location or jurisdiction.
Cost method implementation classes implement the cost method interface. A generic cost method implementation implements the cost interface and implements line level cost methods. For Golf Cart, you define the GenericGOCostMethodsImpl class to implement the cost interface, GOCostMethods.
Each cost subtype has a cost method implementation class that extends the generic class. For Golf Cart, you define the cost method implementation classes as GOCovCostMethodsImpl and GOCartCovCostMethodImpl.
Create the line level interface first, then create the generic cost method implementation. Finally, create the cost specific extensions.
