How it works...
There were a lot of new concepts in this recipe. The first was the use of the table handler class, forgetting the attribute-based constructor for now.
The table handler is useful when the logic gets very complicated and would benefit from being abstracted into a class structure.
If you compare the Insert, Update, and Delete methods to the way this was done in SalesTable and SalesTableType, you will see a key difference. In SalesTable, the call to super() was removed and the handler class calls the equivalent do method directly. Since the standard Insert, Update, and Delete methods simply call the equivalent do method anyway, this may seem fine.
There is a drawback, which detracts from the aim of making our code extensible. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access