Analysis Stereotypes

In UML we can represent categories of elements as stereotypes.

Analysis classes—classes that appear in domain models—often fall into one of four categories:

<<entity>>
<<role>>
<<description>>
<<event>>

An entity is usually something that has physical location and extent. For example:

Person, Computer, Office, City, Item, Document

Entities can be a bit more abstract. For example:

Organization, System, Process, Inventory, WebSite, Program

An event has a start time, an end time, and a description:

class Event {
   private Date start = new Date(); // = creation time
   private Date end;
   private String description;
   // etc.
}

The duration of an event can be from zero seconds (instantaneous) to eons. Examples include:

Transaction, Agreement, Merger, ButtonClick, Decision

A role represents a collection of formal responsibilities within an organization, in other words, a job. Examples include:

Employee, Customer, Provider, Doctor, Nurse, Patient

Entities, events, and roles can have descriptions. Even descriptions can have descriptions. We often represent descriptions as separate objects to allow several objects that share the same description. Examples of descriptions include:

Product, Rank, Title, Type, Category

Here's an example of a simple model involving all four stereotypes:

Normally we think of objects as concrete entities: things that have location, volume, mass, etc. In object-oriented modeling we extend the idea of object to include abstractions such as descriptions, roles, and events. Turning abstractions as objects makes them easier to think about. This technique is called reification, which is a term borrowed from philosophy that is synonymous with objectification.