Today's Smalltalk Daily looks at MethodWrappers, including a small custom example. To download the code (parcel and workspace) used, click here.
The workspace script used:
"count calls"
countWrapper := CountMethodWrapper on: #feedItemSelectionChanged inClass: RSS.RSSFeedViewer.
"install"
countWrapper install.
"uninstall"
countWrapper uninstall.
"before/after wrapper (custom example)"
beforeAfterWrapper := BeforeAfterWrapper on: #feedItemSelectionChanged inClass: RSS.RSSFeedViewer.
"install"
beforeAfterWrapper install.
"uninstall"
beforeAfterWrapper uninstall.
To watch, click on the viewer below:
If you have trouble viewing that directly, you can click here to download the video directly
You can also watch it on YouTube:
Technorati Tags:
smalltalk, method wrappers