In my abstract class can I listen an abstract method and fire an event whenever that method is called? If yes how?
A method which does not have body is known as abstract method. It contains only method signature with a semi colon and, an abstract keyword before it. public abstract myMethod(); To use an abstract method, you need to inherit it by extending its class and provide implementation to it.
An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
Abstract or no, you're looking for an Inversion of Control (IoC) framework here, specifically one that lets you do method interception.
I'd look at Unity, or Spring. There are a few others out there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With