Pedagogical Pattern #12
"What did you eat for breakfast?" Pattern

(Version 1.0)
Karen Karaim Brown
ObjectSpace
kbrown@objectspace.com

Intent:

To teach the use of accessors and mutators for accessing an object's private data.

Motivation:

Students have difficulty remembering to use accessors and mutators (i.e. getters and setters) to retrieve and modify an object's data. It is useful to illustrate that to avoid doing so is dangerous to the object's health, and hence to the application. The WDYEFB pedagogy provides a somewhat graphic, physical metaphor that will clarify the proper use of accessing methods and make students gulp when reminded of the althernative.

Applicability:

Use the What Did You Eat For Breakfast pattern to reinforce the use of accessors and mutators.

Structure:

Consequences:

The WDYEFB pattern:

Implementation:

Issues to consider:

Related Patterns:

(none so far)

Example Instances:

This pattern has been used to teach:


Home Project
Leaders
Pedagogical Pattern
Format
Evolution of a
pedagogical pattern
Sample
Patterns
Publications
Subject
Index
Learning Obj.
Index
Teaching/Learning
Element Index
Alphabetical
Index
Author(s)
Index
Contact
Us
Previous pattern Search This Site Next pattern