CSC/ECE 517 Summer 2008/wiki1 5 bk: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
==Understanding Hooks== | ==Understanding Hooks== | ||
The hooking mechanism in Ruby allows certain functional events in a program to be identified while providing an action that will occur upon detection of the specified event. In this way, hooks serve as a detector of actions within the code. Examples of where such a technique would prove useful include: | |||
*Recording when or how many times a method is called. | |||
*Recording when an object is created. | |||
==Understanding Aspect Oriented Programming== | ==Understanding Aspect Oriented Programming== |
Revision as of 00:14, 3 June 2008
Understanding Hooks
The hooking mechanism in Ruby allows certain functional events in a program to be identified while providing an action that will occur upon detection of the specified event. In this way, hooks serve as a detector of actions within the code. Examples of where such a technique would prove useful include:
- Recording when or how many times a method is called.
- Recording when an object is created.