# Every record has a kind

> This section covers the kind every record carries, drawn from a closed taxonomy.

Page: Architecture · Principles
Canonical: https://banes-lab.com/software-architecture/principles#every-record-has-a-kind

This section is stop 57 of 102 in the learning route. Previous: [01 - Principles are typed](https://banes-lab.com/software-architecture/principles/principles-are-typed.md). Next: [03 - The canon is grouped twice](https://banes-lab.com/software-architecture/principles/the-canon-is-grouped-twice.md). It builds on [01 - Principles are typed](https://banes-lab.com/software-architecture/principles/principles-are-typed.md).

This section covers the kind every record carries, drawn from a [closed taxonomy](https://banes-lab.com/ontology/schema/the-kind-taxonomy.md). How a kind is read from a definition is shown in [B1·a kind from definition](https://banes-lab.com/software-architecture/principles#every-record-has-a-kind-panel-a), the kinds are grouped in [B1·b the fourteen kinds](https://banes-lab.com/software-architecture/principles#every-record-has-a-kind-panel-b), and a kind record is typed in [B1·c a kind record](https://banes-lab.com/software-architecture/principles#every-record-has-a-kind-panel-c). The kind decides what may point at a record, how a tension with it resolves and whether a check can measure it, so a wrong kind is a wrong answer to every one of those questions at once.

### Read the definition, not the name

Everything on a reading list is called a principle, so a quality, a mechanism and a technique are argued as though they were rules. A quality that a system exhibits to a degree is filed as a principle, a check is written to enforce it as a rule, and the check has nothing to return because a degree has no violation to report. Names are chosen for recognition and definitions are written for precision, so the name of a record tends to overclaim its kind, and the overclaim is only visible once the definition is read against the taxonomy.

For this reason a record's kind follows from its definition, and the taxonomy of kinds is closed. Each kind's discriminator is held as data the gate reads, rather than as a reviewer's judgement, so a record whose definition disagrees with its kind is refused rather than shipped. In practice, the definition is read and asked what it describes, whether a degree a system exhibits, a number, a rule that prescribes, a rule that must hold, a facility, a method, an arrangement, a representation, a produced thing, a convention of expression, or a condition to avoid. The kind is assigned from that reading and never from the name.

To check this, take any record and cover its name. Read the definition and name the kind from the definition alone. If it differs from the kind the record carries, the record is mis-filed, and every edge that points at it has been reasoning about the wrong thing. A kind classifies what a record is, never how important it is. Two records of the same kind can differ in severity, and a quality that a whole system depends on is still a quality rather than a rule, because the taxonomy answers one question and severity answers another.

### The fourteen kinds

Each kind answers one question, whether about a rule, a measure, a doing, a shape or a condition to avoid. The pairs most often confused sit closest together. A metric is the measurement and a quality attribute is the property measured, a principle prescribes and a constraint binds, and a mechanism is the facility while a technique is the method a developer applies. The gate checks that every kind is in range, and for a [defined term](https://banes-lab.com/ontology/lexicon) it checks that the kind agrees with the definition, so a term cannot call itself a principle while defining a metric.

### What a name overclaims

Reading a kind off a name is the mistake the taxonomy exists to catch. [Homoiconicity](https://banes-lab.com/records/arch/homoiconicity.md) is a quality attribute, a degree a system exhibits, whatever a reading list calls it. [Orchestration](https://banes-lab.com/records/arch/orchestration.md) and [choreography](https://banes-lab.com/records/arch/choreography.md) are mechanisms, facilities that do a thing. [Pure functions](https://banes-lab.com/records/arch/pure-functions.md) are a technique a developer applies. [Event sourcing](https://banes-lab.com/records/arch/event-sourcing.md) and [CQRS](https://banes-lab.com/records/arch/command-query-responsibility-segregation.md) are patterns, arrangements a design takes. [Fail fast](https://banes-lab.com/records/arch/fail-fast.md) is a principle and [idempotency](https://banes-lab.com/records/arch/idempotency.md) is a principle, because each prescribes.

A check can enforce a principle and measure a metric, but it cannot enforce a quality attribute. A tension between two principles can separate by scope, while a tension between a principle and a quality attribute can only be traded, as derived in [separate, trade, or mitigate](https://banes-lab.com/software-architecture/principles/separate-trade-or-mitigate.md).

B1·a kind from definition

```mermaid
flowchart TB
record["A record"]
question{"What does the definition say it is?"}
property["a property held to a degree · quality attribute"]
number["a measurement · metric"]
rule["a rule that prescribes · principle"]
bound["a rule that must hold · constraint"]
facility["a facility that does it · mechanism"]
method["a method a developer applies · technique"]
arrangement["a design-level arrangement · pattern"]
avoided["a condition to avoid · anti-pattern"]
record --> question
question --> property
question --> number
question --> rule
question --> bound
question --> facility
question --> method
question --> arrangement
question --> avoided
polarity["The polarity law · only conflicts-with may point at an anti-pattern"]
avoided -.-> polarity
```

B1·b the fourteen kinds

```mermaid
flowchart TB
kind(("kind"))
rule["a rule"]
measure["a measure"]
doing["a doing"]
shape["a shape"]
avoid["a condition to avoid"]
kind --> rule & measure & doing & shape & avoid
rule --> principle["principle · prescribes"] & constraint["constraint · must hold"]
measure --> metric["metric · a number"] & quality["quality attribute · a degree"]
doing --> capability["capability · what can be done"] & mechanism["mechanism · the facility"] & technique["technique · the method"] & approach["approach · the strategy"]
shape --> pattern["pattern · an arrangement"] & model["model · a representation"] & convention["style · a convention"] & artifact["artifact · a produced thing"]
avoid --> anti["anti-pattern"]
```

B1·c a kind record

```typescript
export interface KindRecord {
readonly kind: Kind;
readonly discriminator: string;
readonly distinguishesFrom: string;
readonly definitionSignatures: readonly string[];
}

export const kindAgrees = (term: { readonly kind: Kind; readonly definition: string }, taxonomy: readonly KindRecord[]): boolean => {
const record = taxonomy.find((entry) => entry.kind === term.kind);
return record !== undefined && record.definitionSignatures.some((signature) => term.definition.includes(signature));
};
```

## Links to

- [The kind taxonomy](https://banes-lab.com/ontology/schema/the-kind-taxonomy.md)
- [Homoiconicity](https://banes-lab.com/records/arch/homoiconicity.md)
- [Orchestration](https://banes-lab.com/records/arch/orchestration.md)
- [Choreography](https://banes-lab.com/records/arch/choreography.md)
- [Pure Functions](https://banes-lab.com/records/arch/pure-functions.md)
- [Event Sourcing](https://banes-lab.com/records/arch/event-sourcing.md)
- [CQRS](https://banes-lab.com/records/arch/command-query-responsibility-segregation.md)
- [Fail Fast](https://banes-lab.com/records/arch/fail-fast.md)
- [Idempotency](https://banes-lab.com/records/arch/idempotency.md)
- [Separate, trade, or mitigate](https://banes-lab.com/software-architecture/principles/separate-trade-or-mitigate.md)

## Linked from

- [The kind taxonomy](https://banes-lab.com/ontology/schema/the-kind-taxonomy.md)
