3.2.6 Kinds of class
The material below is adapted from Schlaer and Mellor (1988), and Coad and Yourdon (1991).
As a complement to textual analysis, attempts have been made to categorise likely classes by type. Aspects of a system domain that can be modelled appropriately as classes include:
Tangible entities are the physical things in the world of the system domain: aeroplanes, vehicles, reactors, people and so on, i.e. things than can be seen or touched.
Roles are played by people (and other things) in the system domain: employee, student, lecturer, driver and so on. Roles differ from tangible entities in that a single person (a tangible entity) may have a number of different roles, e.g. parent, teacher, library member.
Events. These include any significant circumstance, episode, interaction, happening or incident, e.g. deliveries, registrations, bookings, enrolments. We will discuss the modelling of events in more detail in Section 5.1.
Organisational units. These include any parts of organisational structures to which people or things in the system domain belong – departments, faculties, branches, regions and so on.
Abstract entities. These are things such as plays, novels, pieces of music, theories and political movements. They have an existence but do not correspond to tangible entities. For example, the play Hamlet is an abstract entity, while the books which contain the play are tangible entities.
While consideration of categories such as the above can be useful, you should always remember that the overall purpose is to identify all the classes needed to model significant aspects of the system domain. There will sometimes be classes that do not fit neatly into any of the above categories.
Consider each of our classes for the DVD Library System in terms of the categories above. For each class, decide whether the entities it models fit into one of the five categories, and if so which one.
The candidate classes can be categorised as DVD tangible-entity, member-role, abstract-entity, loan-event.