04 From Business Need To Information Needs

From Business Need To Information Needs

How information travels is the developers' work. What the information is, who owns it and what it means is the business's, and it is the decision that is most expensive to change later. That is why Klok decides the information before the transport: every leg of an integration is built around an agreed datamodel, and the datamodel is built from the business's answers on this page.

You describe the information in business terms. The architect turns the description into a datamodel, chooses how widely it is shared, and designs the legs around it.

Step 1: Find The Business Objects And Events

Go through the need and pick out what happens in the business and what it happens to. Each event that another system must learn about is a flow; each thing the event is about is a business object.

In KLK010 the need ("every employment is registered twice, every worked shift is typed into payroll by hand") gives three flows:

Flow From To Business object
Employments payroll scheduling the employments of one export: who, employment number, degree of employment, unit
Schedule and absence scheduling payroll the worked shifts and absence periods of one period and unit
Substitute bookings scheduling payroll the shifts worked outside a person's own unit

Step 2: Answer Five Questions For Each Business Object

Question Example from KLK010
Who owns it? Which system is its source, and which business area decides what it means? Employments come from payroll and belong to HR. The worked schedule comes from scheduling.
Who needs it? Which systems, and which business areas? Scheduling needs the employments; payroll needs the schedule, the absence and the substitute bookings.
How fresh, and how much? Employments whenever payroll exports them; the schedule for a period when an operator asks for it, with a scheduled export planned.
Which rules give it its meaning? Below.
Will it be stored and searched? The current employment batch is kept in the platform's Operative Data Layer, so that it survives a restart and any instance can serve it.

Step 3: Write The Rules, Not Only The Fields

A Klok information model makes field names, types, required fields, allowed values and the business meaning of each field explicit, and it describes the business rather than copying one system's internal structure. The rules are where integrations usually go wrong, so write them down. KLK010 names three:

  • The producer resolves the overlap. When an absence covers part of a shift, the scheduling side splits the shift and marks the covered part. If every reader worked that out for itself, payroll would get two answers for the same week.
  • Local times name their time zone, so that a change to or from daylight saving time inside a period is unambiguous.
  • A value filled in by default says so. When a missing degree of employment was filled in from configuration, the information says it was defaulted, and the receiver decides whether that is good enough.

Other rules worth asking about: units and currencies, what an empty value means, which codes are allowed and who maintains them, and what identifies the object (an employment number, an organisation number).

Step 4: Decide How Widely It Is Shared

How widely a datamodel is shared decides how carefully it must be changed. Klok has four classes, and the architect picks the narrowest one that fits, because a narrower class is easier to change:

The information Class What a change costs
mirrors the format of one external system, and only that system's own flow reads it X, system follows the external system; whoever reads it must follow that system's changes
belongs to one business area C, domain decided within the domain
is read by several business areas of the organisation B, common agreed between the domains that read it; an old version keeps running at least 3 months
is read by other organisations or outside parties A, public the strictest; every reader is told, and an old version keeps running at least 12 months

Information that several systems or business areas read travels in a shared model (class C or B), never in one system's format. Each system's own format is translated at its edge: the ingress translates from the source system's format, and the egress translates to the receiving system's format just before delivery. KLK010's PersonnelScheduling_v1 (class C, domain HR) is deliberately neither system's format. Before it existed, the payroll side published the scheduling system's own format, so a change of scheduling vendor would have reached all the way back to the payroll export.

Step 5: Prefer The Whole Object

A message should carry the whole business object ("this employment, with all its fields"), not only a notice that something changed ("employment 123 changed"). Then every reader has what it needs without calling back. Very large content, such as images or big files, is stored separately and the message carries a reference to it; the platform handles that.

Step 6: If It Will Be Searched, Say So

Information that is kept in the Operative Data Layer and searched in klok.dev needs a stable identifier, and the fields people search, filter and sort on as simple fields at the top of the model. Tell the architect which fields those are. See Using Datamodels In The ODL.

What The Architect Does With Your Answers

  • Searches for an existing datamodel that fits before proposing a new one: a second model for the same business object makes every later integration choose between them (Finding What Already Exists).
  • Names the datamodel with its major version (PersonnelEmploymentBatchV1), chooses its class and its repository, and writes your rules into its documentation (Creating A Datamodel).
  • Writes it into section 5 of the solution document, with why it is neither system's format.
  • Designs the legs and topics around it (From Requirement To Design).

Changing The Information Later

The change What happens
A new field that readers may ignore The same version is extended, and existing readers keep working.
Removing, renaming or changing the meaning of a field, or making an optional field required A new major version (…V2) runs alongside the old one while every reader moves; the class decides the minimum time the old one keeps running.

Who agrees to a change follows the class: the external system for class X, the owning domain for C, the domains that read it for B, and the owner after telling every reader for A. See Schema Evolution And Versioning.

Checklist

  • [ ] Every flow of the need is named, with where it comes from and where it goes.
  • [ ] Every business object has an owner: a source system and a business area.
  • [ ] Every reader is known: the systems and the business areas.
  • [ ] Freshness and volume are stated for each flow.
  • [ ] The rules that give the information its meaning are written down.
  • [ ] Fields that people will search on are named.
  • [ ] Nothing in the description is one system's internal code without its business meaning.