Hot Spot Framework Development

Up Java Resources C++ Resources .NET Resources DevHood Search

 

What are Hot Spots?

Hot spots are places in component-framework systems where adaptation occurs. There are generally two types of Hot spots, depending on the type of framework in which they occur. In white-box frameworks, which consist of partially-implemented abstract components, hot spots occur at abstract methods. In black-box frameworks, where components are already implemented, while hot spots still occur at abstract methods, the person customizing the framework only cares about order of components.

Hooks and Templates

There are two kinds of methods, hooks and templates. Hooks perform specific tasks on the micro-level. Templates perform tasks on the macro-level, generally calling multiple hooks. Put another way, template methods tell the program what to do; hooks tell the program how. Hot spots generally occur at the points where templates call hooks. Adaptation can occur by modifying templates to call hooks differently, or by modifying hooks to work differently.

Note that a method can be at once a hook and a template. For instance, generating an invoice includes multiple steps, one of which is calculating an amount. Calculating an amount can itself take several steps.

Hooks and templates can either be unified or separated. Unified hooks and templates are implemented in the same class. The only way to adapt them is through inheritance. This generally means the application must be restarted. Separated hooks and templates are implemented in different classes which can be subclassed and adapted independently; the adaptation can happen at runtime. There is also a hybrid scheme, where the template method is implemented in a descendant class of the class where the hook method is implemented. The subclass also contains a pointer to an instance of the superclass, allowing for recursive composition of templates.

Hot Spot-Driven Framework Development

Hot Spot-Driven Framework Development refers to the process of developing a framework which centers around identifying hot spots appropriate to that framework. This should be done jointly by a software engineer who is developing the framework and an expert in the field in which the framework will be used. This is an iterative process:

  1. The software engineer and domain expert identify hot spots appropriate to the framework
  2. The software engineer (re)develops the framework, creating the hotspots as required.
  3. The software engineer and domain expert use the framework and determine whether the hot spots are sufficient and necessary. If not, repeat.
Determining where and what sort of hot spots are needed and what sort of means answering two questions:
  • Which aspects differ from application to application in this domain? A list of hot spots should be the result of this analysis.
  • What is the desired degree of flexibility of these hot spots; that is, must the flexible behavior be changeable at run time and/or by end users?
One way to get at the answers to these questions is using hot spot cards. Similar to user stories from XP, hot spot cards concisely describe a hot spot in terms both the domain expert and the software engineer can understand. They include a description, included desired flexibility, as well as example uses of the hot spot.


arudys@rice.edu
Last modified: Wed Mar 20 05:28:56 CST 2002