Example: Customizing a plugin
This article gives a detailed example on customizing a plugin default implementation. The IPriceCalculator plugin implementation is customized usually to take the price from an ERP system. In this example, the price is simply preset to be just 7, with vat percentage at 25%.
To customize a plugin, the first step is to identify the concrete implementation class. The naming convention in Litium Studio is to have the concrete implementation with same name as the interface but without the preseding "I".
So, the IPriceCalculator default implementation will have the concrete implementation PriceCalculator.
To override the concrete implemenation
- Create a new visual studio class library project. In this example we call it Litium.Studio.KC.Samples.ERPPricing.
- Makesure that the class library project .net framework version is 4.5.2
- Write a class that extend the default concrete implementation, in this example we call it ERPPriceCalculator
- Put the compiled dll output from this project into the webroot\bin directory. Litium Studio automatically detects and uses this implementation instead.
Following is how the visual studio will look like for the above project:
