Need a bit of OOP help.
I have a base payment consisting of SendPayment() UpdateRecord() then child classes implementing different payment formats e.g. PayPal, SagePay.
While all have SendPayment() method they are all implemented differently. So I override the base class to apply my own implementation in each child class. The base classes do not hold any implementation just empty methods. Is this a good way of OOP to have empty methods then implement override code in each child class or remove the empty methods in the base and have these methods in the child classes?
thanks…
Sorry a quick edit. I do use the base class for certain scenarios for example calculation. This covers all payment types such as counting how many products by the cost and removing records from the table.
I would suggest to make your base class as
abstractclass and make the unimplemented method asabstractmethod.Abstractclass is meant for this kind of scenarios where you want to have mix of implemented and unimplemented method. One added advantage here is: Every extending class will be forced to implement its ownsendPaymentmethod.