November 2018
Intermediate to advanced
388 pages
9h 5m
English
The AbstractAuditHandler class will have some reusable components that are used by concrete implementation classes. We declare a field, auditHandler, of the Handler type, and set this using the addHandler() function. This handler instance is used in concrete implementation classes to add the next handler in the chain. Note that we override the addHandler() function in the abstract class itself, as in our case this function does not differ in concrete classes; the implementation is the same. We also have an instance of AuditServiceImpl for which we write the following audit message:
abstract class AbstractAuditHandler : Handler { protected lateinit var auditHandler: Handler protected lateinit var auditService: AuditService ...Read now
Unlock full access