# Examples

Five small examples of the ideas behind SFW. Each one runs in SFW today as a sample package; the patterns behind them are described in Relationship Patterns.

1. Narrowing

Vehicle             has a colour (any colour)
  Toyota car        offers only Toyota colours
    RAV4            offers only RAV4 colours
      my RAV4       is Supersonic Red

Each level states only what differs from the one above. A configured product, a part variant or a single van is one more narrowing.

2. Inheritance

Fleet van           service interval: 20,000 km
  Van12             service interval: 20,000 km   (from Fleet van)
  Van14             service interval: 15,000 km   (its own)

A value set once on a kind reaches everything below it until one needs its own. Files work the same way: a manual on a model reaches every unit of it.

3. Every number can be explained

Chair › Office chair › Office chair Pro
  unit cost = sum of its BOM lines (seat, base, labour)
  margin %  = (price - unit cost) / price
  Why?      → the formula in plain words, its inputs, who approved it

Calculations are approved once and roll up through every level.

4. The same two things, related twice

Employee  works for        Company
Employee  owns shares of   Company

Relationships are named for what they mean, not by the tables they live in, so two independent relationships between the same kinds stay distinct.

5. A database you already have

Part P-1042         from the ERP, read-only (number, description, supplier)
  PFAS status       added in SFW, keyed by the part number
    evidence        supplier file, sheet and cell, template version

SFW maps existing tables in place and keeps what it adds in its own store, without writing to the source. Every added value keeps where it came from.