# Class 32: Design Heuristics (4): Choosing Relationships

Held: Monday, 15 November 2004

Summary: Today we consider when (and when not) to make particular relationship choices.

Related Pages:

Overview:

• Today's strategy
• Choosing a relationship
• Choosing how to get objects to use

## Today's Strategy

• At the end of the last class, Ryan asked Okay, now how do we decide which form of 'uses' to use or which relationship to use?
• The answer, of course, is Heuristics!
• Riel has written some heuristics for us to use. Your challenge will be to figure out which ones apply. Keep your book or the handout handy.
• We may have to write some of our own.

## Strategies for Selecting a Relationship

• We know of a variety of relationships:
• Uses
• Contains
• Contains by association
• Inherits
• Creates
• Associates in other ways
• What strategies suggest what relationships?
• Note that we may have to use uses and associates in other ways as defaults.

## Strategies for Selecting a Use Relationship

• We know a variety of ways to obtain something to use:
• Contain the thing
• Contain the thing by association
• Receive the thing as a parameter
• Query an oracle to receive the thing
• Refer to a very global variable
• Create the thing
• Permit an oracle to forward the request
• When should we use a particular strategy? When should we not use a particular strategy?

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Mon Dec 6 08:50:14 2004.
The source to the document was last modified on Mon Aug 30 08:01:15 2004.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS223/2004F/Outlines/outline.32.html`.

You may wish to validate this document's HTML ; ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu