Accountability
Accountability (also named "Organization Structures" in Fowler's updated version) is an analysis pattern that models employment, contracts, organisation hierarchies, and other issues that arise when one person or organisation is responsible to another.
This analysis pattern covers the modelling of parties (which represent entities such as people and organisations), organisation structure, accountability relationships between parties in the hierarchy, knowledge levels, and operating scopes.
Martin Fowler writes extensively about this analysis pattern in http://www.martinfowler.com/apsupp/accountability.pdf (which can be considered an update to the second chapter from Martin Fowler 1997). This page includes material from both the original chapter and the updated version.
Parties
Fowler defines a Party as an abstraction of people and organisational units.
Take a look through your address book, what do you see? If it's anything like mine you will see a lot of addresses, telephone numbers, the odd email address… all linked to something. Often that something is a person, however the odd company shows up. I call 'Oak Grove Taxi' frequently, but there's no person I want to speak to — I just want to call a cab.
The use of a class such as Party allows much of the common data and behaviour of people and organisations to be abstracted into a single superclass. This mostly consists of contact data such as phone numbers, billing addresses, and so forth.
Organisation hierarchy
In any accountability system, there must be some way to model the hierarchical structure of organisations. Fowler begins by discussing the possibility of modelling the levels of an organisation hierarchy explicitly (i.e. in the class structure). However, such a structure is inflexible and not at all reusable - if the organisation changes its hierarchy at all (e.g. by removing a level to flatten the structure), the model must be reworked.
The Organisation hierarchy pattern provides a highly flexible method for representing organisational hierarchies. It also supports modelling of multiple concurrent hierarchies (such as functional hierarchies and regional hierarchies), although if there are many hierarchies, the design quickly will quickly get out of hand. This can be solved by applying the Accountability pattern (described below).
TODO: Insert demonstration image
Gang of Four design pattern enthusiasts will note that this is a simplified version of the Composite pattern (the difference between leaves and branch nodes has not been extracted out). Each node in the hierarchy is represented by an object at runtime, and each node is of the Organisation class. However, if each node type in the hierarchy requires different behaviour, subtypes of Organisation can be used to represent this, as in the following diagram:
TODO: Insert demonstration image 2
Accountability
The Accountability pattern is used to model a set of complex relationships between parties, such as within an organisation with many different hierarchies (when the Organisation hierarchy pattern doesn't cut it).