I have a .net website written in C # and will create functions that other developers can use. Therefore, I will do some standard implementation, and the developer can overwrite some methods.
Example: I have a class ShoppingCartand the Productproduct class class has a method getProductPrice
then to calculate the total basket price the purchase code will call the methodgetProductPrice
ShoppingCartand Productare in the same project, and I will give the .dll developers so that they cannot change the source code so that we can update the assembly later
Therefore, they need to do another project and extend the product class and overwrite the method getProductPriceso that they can implement their own logic. The problem is that the shopping cart will not call the advanced method, but the original
If we make an already extended project for developers, and shoppingcart calls the advanced method, then we will get a circular link because the extended product needs a link to the product and a shopping cart for the extended product
Partial classes also do not work, because we can only use partial elements within the same assembly
Does anyone have a suggestion?
Thanks in advance.
Marco source
share