The typical responsibilities of Description classes expressed as typcial attributes, operations and associations.

The Description class archetype is one of four class archetypes in Peter Coad's 'modeling in color' object-oriented analysis and design technique.

A Description class models a catalog-entry-like description. It is a collection of values that apply again and again. It also provides behavior across the collection of all things that correspond to its description. [Coad99]

Like all the class archetypes in Peter Coad's 'modeling in color', the usefulness of the Description class archetype in reviewing and building object models is due to its typical responsibilities, and the lists of typical attributes, operations and associations that represent those responsibilities.

Description typical responsibilities
Figure 1: The Typical Responsibilities of a Description

Typical Attributes

Like all four of the class archetypes, Description objects have items of data that they are typcially responsible for remembering. These typically include remembering a short textual description for the items described, for example.

The typical attributes of the Description class archetype remind us to consider these responsibilities when defining a Description class. The actual attributes that they inspire are usually implemented as properties in languages such as Java, C# and Objective-C.

Name
Description
Related Operations
Related Associations

type

A type code or name is an obvious kind of attribute that would typically be found in a Description class. For a car dealership catalog this would be the model name or number of the car e.g. 528i in a BMW dealership or Civic in a Honda dealership.

None

None

description

Description objects often need to have a longer textual description of the item so there is a description attribute in the Description class archetype to reminds us to check if our specific Description classes need this. For example this attribute can provide the two or three lines of marketing teaser in a catalogue extolling the virtues of a BMW 528i or Honda Civic.

None

None

itemNumber The itemNumber attribute suggested by the Description archetype represents the number of the entry for this item in a catalogue. This is usually some sort of local identifier in the same way that the numbers on the menu uniquely identify a dish within a particular Chinese take-away but the numbers for the same dishes are different in different Chinese take-aways.
None None
defaultValue Description classes typically have a set of attributes holding default values or values common for all the entities they described. For example, wheel type (steel or alloy), interior type (cloth or leather), air-conditioning (included or not). Individual cars described by the blue BMW 528i or Honda Civic object may have the default value for these attributes or a customized value.
None None

Typical Operations

The typical operations of Description classes include:


Name
Description
Related
Attributes
Related
Associations

listPartyPlaceThings

A typical responsibility of a Description object is the ability to list all or a subset of the items it describes.

None

Description - Party, Place, Thing

assessAcross
PartyPlaceThings

The assessAcrossPartyPlaceThings() operation suggests that a Description object often benefits from operations that calculate some aspect of the performance of the entities it describes. In our car make and model example that might be an operation to calculate the average sale price of all objects representing the specific cars described by one of Description objects. In other words, what was the average sale price of all the BMW 528i's we have sold? 

None

Description - Party, Place, Thing

findAvailable

The findAvailable() operation reminds us that a typical kind of operation found on a Description class enables users of an object of that class to locate one or more Party, Place, Thing objects that are able to participate in a particular Moment-Interval object.

In our car dealership example this might could translate into an operation for finding a car of a particular make and model that is ready to be sold.

None

Description - Party, Place, Thing

calculateQuantityAvailable
The calculateQuantityAvailable() operation reminds us that a typical kind of operation found on a Description class enables users of an object of that class to count how many Party, Place, Thing objects that are able to participate in a particular Moment-Interval object

In our car dealership example this might could translate into an operation for counting how many cars of a particular make and model are ready to be sold.

Description - Party, Place, Thing
calculateTotalFor
Description objects often need calculateTotalFor() operations that calculate some sort of result for the Party, Place, Thing objects that they describe

In our car dealership example this might could translate into an operation for calculating the profit from all the sales of a particular make and model over a certain period of time.

Description - Party, Place, Thing

listInstances

The listInstances() operation is a class scope operation. It reminds us that a typical responsibility of a Description class, like those of any of the class archetypes, is to be able to search for, find, and list subsets of its instances that match some set of criteria.

None

None

assessAcrossInstances

The assessAcrossInstances() operation is a class scope operation. It reminds us that a typical responsibility of a Description class, like those of any of the class archetypes, is to be able to assess the performance of a subset of its instances that match some set of criteria.


None

None


Typical Associations

The typical attributes of Description classes include:


Name
Description
Related Attributes
Related Operations

Description - Party, Place, Thing

This association links the Description objects to the Party, Place, Thing objects that it describes.

None

assessAcross
PartyPlaceThings


listPartyPlaceThings

findAvailable

calculateQuantityAvailable

calculateTotalFor
Follow me on Twitter...