CSE Roadmap

Common tier · about 4 hours · 8 parts

Part 4 of 8 · 2 min read

Capabilities, not data

Ask what a context does, then what it needs.

A common trap is to design from the database. The first service becomes "Customer", the second "Order", the third "Address", one per table. BM warns that thinking about data leads to anemic services that do little more than create, read, update and delete rows (CRUD). FSA names the same thing the entity trap: one component per entity, which is really the database wearing an architecture costume. FSA says it arises when the architect treats database relationships as workflows, and that it gives the developers no guidance about structure.

BM's cure is a change of question. Ask first "What does this context do?" Ask second "What data does it need to do that?"

Business capability

A business capability is something a part of the business can do for the rest, such as "give the current stock list" or "produce the month-end accounts".

Example: the finance context offers "set up payroll for a new employee". That is a capability. A table of employee rows is only data.

When a context is built as a service, its capabilities become the operations it exposes. Interfaces should use business words as well. BM suggests picturing the messages as forms passed round an office, with the same terms the business already uses.

A worked example (made up). A booking site has tables for User, Booking, Room, Payment and Review. A data-first design makes five services, each a thin wrapper on a table. Booking a room then needs calls to four services, and a refund touches three. A capability-first design asks what the business does: "search availability", "make a booking", "take payment" and "collect feedback". These might be three services: Availability (rooms and calendar), Reservations (bookings and payment status) and Feedback (reviews). A booking now touches one service for most of its work.

Common mistake

Drawing a service for each noun in the data model. Nouns tell what is stored. Capabilities tell what the business does, and changes arrive as changes in what the business does.

Check yourself: 1. What are the two questions BM suggests, and in what order? 2. Why does a service per table cause many calls per request? 3. Turn "Order table" into a capability name.